Go to the source code of this file.
◆ RECV_BUF
◆ EchoHandler()
Definition at line 69 of file echo.c.
VOID WINAPI ExitThread(IN DWORD uExitCode)
static BOOL EchoIncomingPackets(SOCKET sock)
BOOL ShutdownConnection(SOCKET sock, BOOL bRec)
VOID LogEvent(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags)
◆ EchoIncomingPackets()
Definition at line 15 of file echo.c.
28 swprintf(logBuf,
L"Received %d bytes from client", readBytes);
32 while (!
bShutdown && totalSentBytes < readBytes)
34 retVal =
send(
sock, readBuffer + totalSentBytes, readBytes - totalSentBytes, 0);
37 swprintf(logBuf,
L"Sent %d bytes back to client", retVal);
39 totalSentBytes += retVal;
60 }
while ((readBytes != 0) && (!
bShutdown));
INT WSAAPI WSAGetLastError(VOID)
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
int _cdecl swprintf(const WCHAR *,...)
VOID LogEvent(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags)
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
Referenced by EchoHandler().