%SS2_CONNECT
Connect sockets or establish peer address
WSupported on Windows
|
USupported on Unix
|
VSupported on OpenVMS
|
NSupported in Synergy .NET
|
status = %SS2_CONNECT(socket, in_port, in_addr6[, in_timeout])
Return value
status
Returns SS_SUCCESS (0) or one of the errors in Error codes returned by %SS2_CONNECT below. (n)
Arguments
socket
A descriptor of an open socket created by %SS_SOCKET. (i4)
in_port
The internet port of a target socket. (i4)
in_addr6
The IPv4 or IPv6 address of a target socket. ([#]byte)
in_timeout
(optional) The number of seconds to wait for a connection before %SS2_CONNECT returns with an SS_ETIMEDOUT error. If not specified, the function will wait indefinitely for either a successful connection or an error to occur. (n)
Discussion
%SS2_CONNECT connects two stream sockets or establishes a peer address for a datagram socket. It can a be used with both IPv4 and IPv6 formatted addresses.
If socket is a stream socket, %SS2_CONNECT attempts to make a connection to the target stream socket specified by in_port and in_addr6. A stream socket client does not have to call %SS2_BIND to bind a local address before calling %SS2_CONNECT because %SS2_CONNECT automatically binds a random TCP port greater than 1023 to the socket before making a connection.
If socket is a datagram socket, %SS2_CONNECT specifies the peer where datagrams will be sent or received on subsequent %SS_SEND and %SS_RECV calls.
Error codes returned by %SS2_CONNECT
See the Socket Errors table for additional information about these errors.
SS_EADDRINUSE
SS_EADDRNOTAVAIL
SS_EBADF
SS_ECONNREFUSED
SS_ECONNRESET
SS_EDESTADDRREQ
SS_EINTR
SS_EISCONN
SS_EMFILE
SS_ENETDOWN
SS_ENETUNREACH
SS_ENOBUFS
SS_ENOTSOCK
SS_ETIMEDOUT
SS_EUNKNOWN
SS_NOTINITIALISED