<< Previous | Index | Next >>

tcp_extopen


int tcp_extopen( tcp_Socket *s, int iface, word lport,
longword remip, word port, dataHandler_t datahandler,
long buffer, int buflen );

Description

Actively creates a session with another machine. The buffer and buflen parameters allow a user to supply a socket buffer, instead of using a socket buffer from the pool. tcp_extopen() is an extended version of tcp_open().

s

Pointer to socket's data structure.

iface

Local interface on which to open the socket. Use IF_ANY if interface is to be selected automatically based on the destination IP address.

lport

Our port, zero for the next one available in the range 1025-65536.

remip

IP address to connect to.

port

Port to connect to.

datahandler

Function to call when data is received, NULL for placing data in the socket's receive buffer. Prior to Dynamic C 7.30, some details for implementation of this service had not been finalized. Insert a value of NULL if you are using a version of Dynamic C prior to 7.30.

buffer

Address of user-supplied socket buffer in xmem. This is the return value of xalloc(). If buffer is 0, the socket buffer for this socket is pulled from the buffer pool defined by the macro MAX_TCP_SOCKET_BUFFERS.

buflen

Length of user-supplied socket buffer.

Return value

 0:Error, unable to resolve the remote computer's hardware address.
!0: Success.

Library

TCP.LIB

See also

tcp_open


TCP/IP Manual
Vol 1
<<Previous | Index | Next>> rabbit.com