readBytes = recv(sock, readBuffer, RECV_BUF, 0);
if (readBytes > 0)
{
- _swprintf(logBuf, L"Received %d bytes from client", readBytes);
+ swprintf(logBuf, L"Received %d bytes from client", readBytes);
LogEvent(logBuf, 0, 0, LOG_FILE);
totalSentBytes = 0;
retVal = send(sock, readBuffer + totalSentBytes, readBytes - totalSentBytes, 0);
if (retVal > 0)
{
- _swprintf(logBuf, L"Sent %d bytes back to client", retVal);
+ swprintf(logBuf, L"Sent %d bytes back to client", retVal);
LogEvent(logBuf, 0, 0, LOG_FILE);
totalSentBytes += retVal;
}
sock = accept(listeningSocket, (SOCKADDR*)&client, &addrSize);
if (sock != INVALID_SOCKET)
{
- _swprintf(logBuf,
- L"Accepted connection to %s server from %S:%d",
- lpName,
- inet_ntoa(client.sin_addr),
- ntohs(client.sin_port));
+ swprintf(logBuf,
+ L"Accepted connection to %s server from %S:%d",
+ lpName,
+ inet_ntoa(client.sin_addr),
+ ntohs(client.sin_port));
LogEvent(logBuf, 0, 0, LOG_FILE);
- _swprintf(logBuf, L"Creating worker thread for %s", lpName);
+ swprintf(logBuf, L"Creating worker thread for %s", lpName);
LogEvent(logBuf, 0, 0, LOG_FILE);
if (!bShutdown)
}
else
{
- _swprintf(logBuf, L"Failed to start worker thread for the %s server",
- lpName);
+ swprintf(logBuf, L"Failed to start worker thread for the %s server",
+ lpName);
LogEvent(logBuf, 0, 0, LOG_FILE);
}
}
ret = recv(sock, readBuffer, BUF, 0);
if (ret >= 0)
{
- _swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret);
+ swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret);
LogEvent(logBuf, 0, 0, LOG_FILE);
}
} while (ret > 0);
pServices = (PSERVICES)lpParam;
- _swprintf(logBuf, L"Starting %s server", pServices->lpName);
+ swprintf(logBuf, L"Starting %s server", pServices->lpName);
LogEvent(logBuf, 0, 0, LOG_FILE);
if (!bShutdown)
listeningSocket = SetUpListener(htons(pServices->Port));
if (!bShutdown && listeningSocket != INVALID_SOCKET)
{
- _swprintf(logBuf,
- L"%s is waiting for connections on port %d",
- pServices->lpName,
- pServices->Port);
+ swprintf(logBuf,
+ L"%s is waiting for connections on port %d",
+ pServices->lpName,
+ pServices->Port);
LogEvent(logBuf, 0, 0, LOG_FILE);
AcceptConnections(listeningSocket, pServices->lpService, pServices->lpName);
}
}
- _swprintf(logBuf,
- L"Exiting %s thread",
- pServices->lpName);
+ swprintf(logBuf, L"Exiting %s thread", pServices->lpName);
LogEvent(logBuf, 0, 0, LOG_FILE);
ExitThread(0);
}
if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0)
{
- _swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal);
+ swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal);
LogEvent(buf, 0, 100, LOG_ALL);
return FALSE;
}
/* Create worker threads. */
for (i = 0; i < NUM_SERVICES; i++)
{
- _swprintf(buf, L"Creating thread for %s server", Services[i].lpName);
+ swprintf(buf, L"Creating thread for %s server", Services[i].lpName);
LogEvent(buf, 0, 0, LOG_FILE);
hThread[i] = CreateThread(NULL,
if (hThread[i] == NULL)
{
- _swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName);
+ swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName);
LogEvent(buf, GetLastError(), 0, LOG_ALL);
return FALSE;
}