Go to the source code of this file.
◆ BUF
◆ AcceptConnections()
Definition at line 55 of file skelserver.c.
58{
66
67 timeVal.
tv_sec = timeOut / 1000;
68 timeVal.
tv_usec = timeOut % 1000;
69
71 {
73
75 FD_SET(listeningSocket, &readFD);
76
78 if (selRet > 0)
79 {
81 {
83
86 {
88 L"Accepted connection to %s server from %S:%d",
93
96
98 {
101 {
103 }
104 else
105 {
106 swprintf(logBuf,
L"Failed to start worker thread for the %s server",
109 }
110 }
111 }
112 else
113 {
115 }
116 }
117 }
119 {
121 }
122 }
123}
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
VOID LogEvent(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
#define FD_ISSET(fd, set)
int PASCAL FAR WSAGetLastError(void)
struct sockaddr_in SOCKADDR_IN
Referenced by StartServer().
◆ SetUpListener()
Definition at line 15 of file skelserver.c.
16{
20
23 {
28
30 {
32 {
34 }
35 else
36 {
38 }
39 }
40 else
41 {
43 }
44 }
45 else
46 {
48 }
49
51}
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
static rfbScreenInfoPtr server
Referenced by StartServer().
◆ ShutdownConnection()
Definition at line 126 of file skelserver.c.
128{
130
131
132
133
135 {
138 }
139
140
141
142 if (bRec)
143 {
146
147 do
148 {
151 {
152 swprintf(logBuf,
L"FYI, received %d unexpected bytes during shutdown",
ret);
154 }
156 }
157
159
161}
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
INT WSAAPI shutdown(IN SOCKET s, IN INT how)
Referenced by ChargenHandler(), DaytimeHandler(), DiscardHandler(), EchoHandler(), and QotdHandler().
◆ StartServer()
Definition at line 165 of file skelserver.c.
166{
170
172
175
177 {
180 {
182 L"%s is waiting for connections on port %d",
186
188 }
189 else
190 {
192 }
193 }
194
198}
VOID WINAPI ExitThread(IN DWORD uExitCode)
static SOCKET SetUpListener(USHORT Port)
static VOID AcceptConnections(SOCKET listeningSocket, LPTHREAD_START_ROUTINE lpService, LPWSTR lpName)
LPTHREAD_START_ROUTINE lpService
struct _Services * PSERVICES
Referenced by CreateServers(), and DECLARE_INTERFACE_().