Proc, wcName); 135 WSAAsyncSelect(S, Wnd, WM_SOCKET, FD_ACCEPT or FD_CLOSE); 136 //Writeln(SysErrorMessage(WSAGetLastError()), ' Wnd: ', Wnd);
137 Listen(S, 5); 138 end; 139
140 procedure SysFina; 141 begin
142 Windows.UnregisterClass(wcName, HInstance); 143 WSACleanup; 144 end; 145
146 procedure Stay; 147 var msg: TMsg; 148 begin
149 while GetMessage(msg, 0, 0, 0) do begin
150 TranslateMessage(msg); 151 DispatchMessage (msg); 152 end; 153 PostQuitMessage(0); 154 end; 155
156 begin
157 //if InitProc <> nil then TProcedure(InitProc);
158 SrvListen(ListenPort); 159 Stay; 160 SysFina; 161 Halt(0); 162 end.
|