connect(2dn)
NAME
connect − initiate a connect request
SYNTAX
#include <sys/types.h>
#include <sys/socket.h>
#include <netdnet/dn.h>
connect (s,name,namelen)
int s;
struct sockaddr_dn, *name;
int namelen
ARGUMENTS
Input Arguments
s Specifies a descriptor for a socket that has been returned by the socket call. This descriptor is used for establishing a connection between programs.
name Specifies the address of a structure of the type sockaddr_dn. This address identifies the destination process for the connect.
namelen Specifies the size of the address of the structure sockaddr_dn. The following data fields are filled in by this call:
sdn_family specifies the communications domain as AF_DECnet.
sdn_flags specifies the object flag option, which you can use to request outgoing proxy. See the DECnet-ULTRIX User’s and Programmer’s Guide for more information.
sdn_objnum specifies the DECnet object number to which you are connecting. If the object number is 0, the DECnet object name, sdn_objname, is used.
sdn_objnamel specifies the size of the object name to which you are connecting. This argument is used only when the DECnet object number, sdn_objnum, is 0.
sdn_objname specifies the name of the destination program. This argument is used only when the DECnet object number, sdn_objnum, is 0.
DESCRIPTION
The connect call issues a connect request to a server program. The server program is specified by the name argument, which is an address in the DECnet domain.
Optional user data and access control information are passed with the connect call if this data is previously set with the setsockopt call.
Return Value
If the connect succeeds, a value of 0 is returned. If the connect fails, a value of -1 is returned and the external variable errno contains error detail.
DIAGNOSTICS
[EBADF] The s argument is not a valid descriptor.
[EAFNOSUPPORT] Addresses in the specified address family cannot be used with this particular socket.
[EISCONN] The socket is already connected.
[ETIMEDOUT] Connection establishment was timed out before a connection was established.
[ECONNREFUSED] The attempt to connect was refused by the remote node.
[EFAULT] The name argument specifies an area outside the process address space.
[EINVAL] The namelen argument is not the size of sockaddr_dn, or sdn_objnamel is not in the range of 0 to 16.
[INPROGRESS] The socket is nonblocking and the connection is in progress. To determine when the connection has either completed or failed, select the socket for write using the select call.
[ENOSPC] There are no resources available for a new connection at either the local or remote system.
[ENETDOWN] The node is shutting down.
[ETOOMANYREFS] The remote user has too many active logical links.
[EACCESS] The Access Control information was rejected.
[EADDRNOTAVAIL] No such node.
[ESRCH] Unrecognized object at the remote node.
[EHOSTDOWN] Local node is shut down.
[EHOSTUNREACH] Node unreachable.
SEE ALSO
accept(2dn), close(2dn), dnet_conn(2dn), setsockopt(2dn), socket(2dn)