source: titan/mediathek/localhoster/lib/python2.7/site-packages/twisted/internet/iocpreactor/iocpsupport/wsasend.pxi @ 40660

Last change on this file since 40660 was 40660, checked in by obi, 7 years ago

next test

File size: 694 bytes
Line 
1# Copyright (c) Twisted Matrix Laboratories.
2# See LICENSE for details.
3
4
5def send(long s, object buff, object obj, unsigned long flags = 0):
6    cdef int rc
7    cdef myOVERLAPPED *ov
8    cdef WSABUF ws_buf
9    cdef unsigned long bytes
10    cdef Py_ssize_t size
11
12    PyObject_AsReadBuffer(buff, <void **>&ws_buf.buf, &size)
13    ws_buf.len = <DWORD>size
14
15    ov = makeOV()
16    if obj is not None:
17        ov.obj = <PyObject *>obj
18
19    rc = WSASend(s, &ws_buf, 1, &bytes, flags, <OVERLAPPED *>ov, NULL)
20
21    if rc == SOCKET_ERROR:
22        rc = WSAGetLastError()
23        if rc != ERROR_IO_PENDING:
24            PyMem_Free(ov)
25            return rc, bytes
26
27    Py_XINCREF(obj)
28    return rc, bytes
29
30
Note: See TracBrowser for help on using the repository browser.