21#ifndef _TnbWINSOCK2_ENABLE
50 CSocketXp(
void) : m_isInit(true), m_lpfnTransmitPackets(NULL)
62 bool Send(SOCKET so,
size_t dataSize, LPCVOID lpcvData)
66 TRANSMIT_PACKETS_ELEMENT packets;
67 packets.dwElFlags = TP_ELEMENT_MEMORY;
68 packets.cLength = dataSize;
69 packets.pBuffer =
const_cast<void* const
>(lpcvData);
70 return !! m_lpfnTransmitPackets(so, &packets, 1, 0, NULL, 0);
72 int r = ::send(so,
static_cast<const char*
>(lpcvData), dataSize, 0);
73 TRACE2(
"::send(%u) result = %d\n", dataSize, r);
74 return r ==
ToInt(dataSize);
79 LPFN_TRANSMITPACKETS m_lpfnTransmitPackets;
81 bool m_Init(SOCKET so)
87 GUID guidTransmitPackets = WSAID_TRANSMITPACKETS;
88 ::WSAIoctl(so, SIO_GET_EXTENSION_FUNCTION_POINTER, &guidTransmitPackets,
sizeof(GUID), &m_lpfnTransmitPackets,
sizeof(LPVOID), &dwBytes, NULL, NULL);
90 return m_lpfnTransmitPackets != NULL;
123 virtual bool m_Send(SOCKET so,
size_t dataSize, LPCVOID lpcvData)
125 _super::m_OnSend(dataSize, lpcvData);
126 if ( so == INVALID_SOCKET )
130 return m_xp.
Send(so, dataSize, lpcvData);
170 virtual bool m_Send(SOCKET so,
size_t dataSize, LPCVOID lpcvData)
172 _super::m_OnSend(dataSize, lpcvData);
173 if ( so == INVALID_SOCKET )
177 return m_xp.
Send(so, dataSize, lpcvData);
186 #define CSocketClient CSocketClientXp
187 #define CSocketServer CSocketServerXp
virtual bool m_Send(SOCKET so, size_t dataSize, LPCVOID lpcvData)
送信
virtual bool m_Send(SOCKET so, size_t dataSize, LPCVOID lpcvData)
送信
bool Send(SOCKET so, size_t dataSize, LPCVOID lpcvData)
[送信] 送信.
int ToInt(LPCSTR lpsz, int iBase=10)
[変換] INT変換(ASCII/SJIS用).