Description: This function starts a TCP/IP or UDP socket server and returns a handle to it.
Returns: Handle
Usage: Script
Format: SocketServerStart(Family, Port, TransmitLen, ReceiveLen, NoDelay[, ProtocolFilter] )
Parameters: Family { numeric } { required } { no default: }
Any numeric expression for the protocol family:
|
Family |
Description |
|
0 |
TCP/IP |
|
1 |
UDP |
Port { numeric } { required } { no default: }
Any numeric expression for the port number to offer.
TransmitLen { numeric } { required } { no default: }
(deprecated) Any numeric expression for the number of bytes to buffer when transmitting. This value should be the maximum number of bytes plus 1024 (1 k); the minimum acceptable value is 1024.
ReceiveLen { numeric } { required } { no default: }
Any numeric expression for the number of bytes that VTS will buffer internally before it stops reading from WinSock. Additional buffering is handled by WinSock.
This value should be the maximum number of bytes plus 1024 (1 k); the minimum acceptable value is 1024.
NoDelay { Boolean } { required } { no default: }
Any logical expression. If true, anything written to a socket started by this server will be flushed immediately. If false, packets are coalesced into larger packets to reduce network loading. This parameter should normally be false.
ProtocolFilter { Array } { optional } { no default: }
An optional array of 2-element text arrays. Each 2-element array specifies a protocol which may connect to the socket. Their order in the ProtocolFilter array determines priority.
The first element in each array is the name of the protocol. The second contains the initialization string for that protocol, if required; empty string otherwise.
The available protocols are: “SSL”, “VIC”, “NULL” and “PROXY”.
Comments: If the parameters are all valid and the socket function fails a negative error code is returned.
If the handle to the socket is orphaned, the equivalent to a SocketServerEnd is performed
RecieveLen and NoDelay apply to streams created by inbound connections (TCP) or datagrams (UDP), not to the listener.
The handle returned can be used by the SocketWait or SocketServerEnd functions.
See Also:
ClientSocket | CloseStream | ServerSocket | SocketAttribs | SocketServerEnd | SocketWait | SRead | SWrite | TCPIPReset