Creates a listener socket on a specified port and returns a handle to that socket.
WebAPI.bdh
WebTcpipListen( inout hTcpipListen : number in nPort : number ): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hTcpipListen | Variable receiving a handle to the listener socket. |
nPort | Specifies the port number to listen at. |
dcltrans transaction TServer var hTcpip, hListen, nRecv : number; sData : string; begin // start listening on port 88 WebTcpipListen(hListen, 88); // accept client request WebTcpipAccept(hListen, hTcpip); // receive data from the client WebTcpipRecvUntil(hTcpip, sData, STRING_COMPLETE, nRecv, "\r\n\r\n", 4); // process the client’s request // close connections WebTcpipShutdown(hTcpip); WebTcpipShutdown(hListen); end TServer;