<< Previous | Index | Next >>

tcp_extlisten


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

Description

This function tells DCRTCP that an incoming session for a particular port will be accepted. The buffer and buflen parameters allow a user to supply a socket buffer, instead of using a socket buffer from the pool. tcp_extlisten() is an extended version of tcp_listen().

Parameters

s

Pointer to the socket's data structure.

iface

Local interface on which to open the socket. Use IF_ANY if the socket is to accept connections from any interface. Otherwise, connections will be accepted only from the specified interface.

Prior to Dynamic C 7.30 this parameter was not implemented and should be IF_DEFAULT.

lport

Port to listen on.

remip

IP address to accept connections from or 0 for all.

port

Port to accept connections from or 0 for all.

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.

reserved

Set to 0 for now. This parameter is for compatibility and possible future use.

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: Failure.
1: Success.

Library

TCP.LIB


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