1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
5 def send(long s, object buff, object obj, unsigned long flags = 0):
9 cdef unsigned long bytes
12 PyObject_AsReadBuffer(buff, <void **>&ws_buf.buf, &size)
13 ws_buf.len = <DWORD>size
17 ov.obj = <PyObject *>obj
19 rc = WSASend(s, &ws_buf, 1, &bytes, flags, <OVERLAPPED *>ov, NULL)
21 if rc == SOCKET_ERROR:
22 rc = WSAGetLastError()
23 if rc != ERROR_IO_PENDING: