AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Syntax:     int connect(int s, struct sockaddr *name, int namelen);
Header:     NetLib -     sys/socket.h
     Sockets -     socklib.h
     UnixLib -     sys/socket.h

Returns:     0 for success, EOF if failed

This call initiates a connection from the specified socket to a given address on another host.

When used on a raw or datagram socket, this will simply fix the remote address for future calls to Socket_Send or send(), and this remote address can be changed by calling this routine again.

For Stream sockets, the stack will attempt to make a connection to the specified address, and will block until the connection is achieved or the attempt fails. If the socket has been marked non-blocking it will instead return immediately with the error EINPROGRESS and will continue with the connection attempt on its own.

C definition     SWI definition

[sh-index] Back to list of manuals