Function SocketOpen() Professional

Creates a bound socket and connects it to a remote process.

Syntax
SocketOpen( [<nSocketType>] , ;
            <cRemoteAddress>, ;
            <nPort>         , ;
            [@<nError>]       ) --> nSocket
Parameters
<nSocketType>
Constants from the file SOCKET.CH must be used for this parameter:
Type of socket to create
Constant Description
SOCK_STREAM *) TCP stream socket
SOCK_DGRAM UDP datagram socket
  1. default
<cRemoteAddress>
The remote address is specified with a character string containing the DNS name of the remote station or its IP address in dotted octet notation.
<nPort>
This is the numeric port number on the local computer to bind the socket to.
<nError>
If this parameter is passed by reference to the function, it gets assigned a numeric error code when the function fails. #define constants beginning with WSAE are available in the file SOCKET.CH to identify an error condition.
Return

On success the function returns the numeric socket value, otherwise a numeric 0 is returned.

Description

SocketOpen() is called on the client side of a communication channel. The function creates a new socket, binds it to the specified address and port, and establishes a connection to a remote process. This is equivalent to calling the functions SocketNew() and SocketConnect(). When the connection is successful, data can be sent or received via this socket.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.