soBind (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


The soBind function assigns a local address to a socket.

 

This function is required on an unconnected socket before subsequent calls to the soListen function, to set the port and optionally the interface to listen on.

It may be used on an unconnected socket before subsequent calls to the soConnect function, to set the interface and optionally the port.

 

If the address refer to a network interface, then the socket will only use this interface for communication.

 

 

Input:

socket : SYSHANDLE

Handle to the socket.

 

address : STRING

The address to bind to.

See also soAddrFromInterface.

 

 

Returns: INT

1

- Success.

0

- The function is not supported.

-1

- The handle is not a valid socket.

-2

- One or more parameters are illegal.

-3

- The socket is closed.

-8

- The local address is already used by another socket.

-16

- The socket is already bound.

-17

- Generic error.

-18

- Illegal address.

 

Declaration:

FUNCTION soBind : INT;
VAR_INPUT
  socket  : SYSHANDLE;
  address : STRING;
END_VAR;

 

 


Example:

 

Please see the "Examples - Telnet server2"