Binds a socket to a specified port that is designated to listen for client connections.
The port number is usually a standard, or previously agreed upon, port that clients use to contact a server. For example, by convention, most Web servers listen for connections on port 80. Most hosts have ports numbered between 1 and 65,535. Typically, ports 0 to 1024 are reserved and only available to someone with administrator or super user privileges.
The returned socket handle is used by other SOCKET_* routines to identify a particular socket connection.
It is good practice to close the socket handle when you are finished with it.
PRO SERVER port = 1500 socket = SOCKET_INIT(port) connection = SOCKET_ACCEPT(socket) data = BYTARR(15) nbytes = SOCKET_READ(connection,data) PRINT, 'SERVER received: ', STRING(data) SOCKET_CLOSE, connection SOCKET_CLOSE, socket ENDSee Also
For more detailed information on using the socket routines, see Interapplication Communication Using the Socket OPI.