Listen Method

Listen for incoming connections.

Syntax

object.Listen( [ LocalAddress ], [ LocalPort ], [ Backlog ] )

Remarks

The Listen method causes the control to listen on a socket for incoming connections on a particular local address and local port. All arguments are optional. If a given argument is missing, then a corresponding property or properties must be set before attempting the connection, as follows:

The optional LocalAddress argument specifies the IP address of the network adapter that the control should use when listening for connection requests. If this argument is not specified, the control will bind to any suitable adapter on the local system.

The optional LocalPort argument specified the port number to listen for connections on. If this argument is not provided, it defaults to the value specified by the LocalPort or LocalService properties.

The optional Backlog argument specifies the maximum size of the queue used to manage pending connections to the service. If the argument is set to value which exceeds the maximum size for the underlying service provider, it will be silently adjusted to the nearest legal value. If this argument is not provided, the value specified by the Backlog property will be used.

Return Value

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure. This method will return an error if a socket has already been created by a previous call to the Connect method.

See Also

Backlog Property, LocalPort Property, LocalService Property, Accept Method, Connect Method, Reject Method, OnAccept Event


Copyright © 2008 Catalyst Development Corporation. All rights reserved.