man3tcp/BldSendSocket

Table of Contents

Name

BldSendSocket - manage client socket creation

Description

BldSendSocket() creates a client socket but doesn’t make a TCP connection.

ConnectSendSocket() causes the socket to be connected to the destination specified when the socket was created.

DestroySendSocket() closes the connection and deallocates the data structure associated with it.

These functions are part of libtcp.

They are meant to be used as part of a bigger process to manage sockets in an asyncronous way.

Syntax

int BldSendSocket(
   char *Hn,

   char *Sn,

   char *Sc,

   int default_port,

   char **conn,

   int verbosity

   );

int ConnectSendSocket(
   void *conn,

   int verbosity

   );

int DestroySendSocket(
   void *conn

   );

Arguments

Hn

Host name from /etc/hosts or dns lookup. This may also be specified as an IP address. If the argument is NULL, localhost will be used.

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.

conn

A pointer to a pointer used to store a the address of a data structure used internally by the function.

verbosity

Control the printing of messages generated by BldSendSocket() and ConnectSendSocket(). All messages are printed to stderr.

0 = suppress all messages

1 = suppress the connection open msg, print other messages

2 = print all messages

Returns

ERRok if successful. ERRconn on most other failures.

See Also

libtcp(3tcp)

Manual page revision

$Id: BldSendSocket.3,v 1.2 2008/09/15 15:04:41 kitchen Exp $


Table of Contents