man3tcp/BldServiceChan

Table of Contents

Name

BldServiceChan - create a server side tcp listener connection

Description

BldServiceChan creates a server side listener tcp connection.

This function is part of libtcp.

Syntax

int BldServiceChan (
   char *Hn,

   char *Sn,

   char *Sc,

   int default_port,

   int verbosity

   );

Arguments

Hn

Host name from /etc/hosts or dns lookup. This may also be specified as an IP address.

If hostname is null, then the listener socket is bound to all interfaces on the host, else the listener is bound only to the the ip address of the specified hostname.

Sn

Service name from /etc/services. This may also be specified as a port number.

Sc

Service class from /etc/services.

This may be a NULL pointer. If it is then getservbyname() will return the first available entry.

Usually we specify this as "tcp" because this all AccelNET connections are "tcp" class and we aren’t interested in other classes such as "udp".

See the getservbyname() man page for more information.

default_port

Default port number to use if /etc/services lookup fails.

verbosity

Control the printing of messages generated by BldServiceChan(). All messages are printed to stderr.

0 = suppress all messages

1 = suppress the connection open msg, print other messages

2 = print all messages

Returns

File descriptor of socket if successful. ERRconn on most other failures.

See Also

libtcp(3tcp)

Manual page revision

$Id: BldServiceChan.3,v 1.4 2008/09/15 15:04:41 kitchen Exp $


Table of Contents