Lines Matching refs:Sock
151 static int rtTcpClose(RTSOCKET Sock, const char *pszMsg, bool fTryGracefulShutdown);
833 RTSOCKET Sock;
834 rc = rtSocketCreate(&Sock, PF_INET, SOCK_STREAM, 0);
837 RTSocketSetInheritance(Sock, false /*fInheritable*/);
840 rc = rtSocketConnect(Sock, &Addr, cMillies);
843 RTSocketRetain(Sock);
844 if (ASMAtomicCmpXchgPtr(ppCancelCookie, (PRTTCPCLIENTCONNECTCANCEL)Sock, NULL))
846 rc = rtSocketConnect(Sock, &Addr, cMillies);
847 if (ASMAtomicCmpXchgPtr(ppCancelCookie, NULL, (PRTTCPCLIENTCONNECTCANCEL)Sock))
848 RTSocketRelease(Sock);
854 RTSocketRelease(Sock);
860 *pSock = Sock;
864 rtTcpClose(Sock, "RTTcpClientConnect", false /*fTryGracefulShutdown*/);
888 RTR3DECL(int) RTTcpClientClose(RTSOCKET Sock)
890 return rtTcpClose(Sock, "RTTcpClientClose", true /*fTryGracefulShutdown*/);
894 RTR3DECL(int) RTTcpClientCloseEx(RTSOCKET Sock, bool fGracefulShutdown)
896 return rtTcpClose(Sock, "RTTcpClientCloseEx", fGracefulShutdown);
937 static int rtTcpClose(RTSOCKET Sock, const char *pszMsg, bool fTryGracefulShutdown)
942 if (Sock == NIL_RTSOCKET)
951 rc = RTSocketShutdown(Sock, false /*fRead*/, true /*fWrite*/);
953 RTHCUINTPTR hNative = RTSocketToNative(Sock);
986 rc = RTSocketSelectOneEx(Sock, RTSOCKET_EVT_READ | RTSOCKET_EVT_ERROR, &fEvents, 1000);
1004 rc = RTSocketReadNB(Sock, &abBitBucket[0], sizeof(abBitBucket), &cbRead);
1019 return RTSocketClose(Sock);
1023 RTR3DECL(int) RTTcpRead(RTSOCKET Sock, void *pvBuffer, size_t cbBuffer, size_t *pcbRead)
1025 return RTSocketRead(Sock, pvBuffer, cbBuffer, pcbRead);
1029 RTR3DECL(int) RTTcpWrite(RTSOCKET Sock, const void *pvBuffer, size_t cbBuffer)
1031 return RTSocketWrite(Sock, pvBuffer, cbBuffer);
1035 RTR3DECL(int) RTTcpFlush(RTSOCKET Sock)
1038 int rc = rtSocketSetOpt(Sock, IPPROTO_TCP, TCP_NODELAY, &fFlag, sizeof(fFlag));
1042 rc = rtSocketSetOpt(Sock, IPPROTO_TCP, TCP_NODELAY, &fFlag, sizeof(fFlag));
1048 RTR3DECL(int) RTTcpSetSendCoalescing(RTSOCKET Sock, bool fEnable)
1051 return rtSocketSetOpt(Sock, IPPROTO_TCP, TCP_NODELAY, &fFlag, sizeof(fFlag));
1055 RTR3DECL(int) RTTcpSelectOne(RTSOCKET Sock, RTMSINTERVAL cMillies)
1057 return RTSocketSelectOne(Sock, cMillies);
1061 RTR3DECL(int) RTTcpSelectOneEx(RTSOCKET Sock, uint32_t fEvents, uint32_t *pfEvents,
1064 return RTSocketSelectOneEx(Sock, fEvents, pfEvents, cMillies);
1068 RTR3DECL(int) RTTcpGetLocalAddress(RTSOCKET Sock, PRTNETADDR pAddr)
1070 return RTSocketGetLocalAddress(Sock, pAddr);
1074 RTR3DECL(int) RTTcpGetPeerAddress(RTSOCKET Sock, PRTNETADDR pAddr)
1076 return RTSocketGetPeerAddress(Sock, pAddr);
1080 RTR3DECL(int) RTTcpSgWrite(RTSOCKET Sock, PCRTSGBUF pSgBuf)
1082 return RTSocketSgWrite(Sock, pSgBuf);
1102 RTR3DECL(int) RTTcpReadNB(RTSOCKET Sock, void *pvBuffer, size_t cbBuffer, size_t *pcbRead)
1104 return RTSocketReadNB(Sock, pvBuffer, cbBuffer, pcbRead);
1108 RTR3DECL(int) RTTcpWriteNB(RTSOCKET Sock, const void *pvBuffer, size_t cbBuffer, size_t *pcbWritten)
1110 return RTSocketWriteNB(Sock, pvBuffer, cbBuffer, pcbWritten);
1114 RTR3DECL(int) RTTcpSgWriteNB(RTSOCKET Sock, PCRTSGBUF pSgBuf, size_t *pcbWritten)
1116 return RTSocketSgWriteNB(Sock, pSgBuf, pcbWritten);