- Re-creating a socket
- Re-using an address that is already used
- Connecting to an infrared port
- Required permissions
- Required application feature
SocketCreate (Function) In french: SocketCrée Creates a socket. A socket is a communication resource used by applications to communicate from one computer to another regardless of the type of network. Remarks: - This function must be called on the server used for the communication. If the client computer is using a WINDEV application to connect to this socket, this application will have to use SocketConnect.
- SSL sockets: To create an SSL socket, use SocketCreateSSL.
- UDP sockets: To create a UDP socket, use SocketCreateUDP.
IF SocketCreate("Server", 8000) = False THEN Error("creation error" + ErrorInfo(errMessage)) END
Syntax
<Result> = SocketCreate(<Socket name> , <Port number> [, <Address>])
<Result>: Boolean - True if the function was successful,
- False otherwise. If an error occurs, you can get more details on the error with ErrorInfo.
<Socket name>: Character string Name that will be given to the socket. This name will be used by all socket functions. Caution: the socket name is case sensitive. <Port number>: Integer Port number that will be given to the socket. This number must be included between 1 and 65000. This number will be specified when the client computers are connected to the server.
<Address>: Optional character string IP address on which the socket must be created on the current computer. If the current computer is associated with several IP addresses (or with several network cards), this parameter enables you to choose the IP address that will be associated with the socket.This IP address can have the following format: - IP address in XXX.XXX.XXX.XXX format (125.5.110.100 for example).
- IP address containing the name of the server (www.windev.com for example). This syntax is recommended.
Remarks Re-creating a socket If a socket is not closed properly by SocketClose (restarting the computer for example), re-creating the socket may take quite a long time. Indeed, you will have to wait until the socket is freed by the system.
This page is also available for…
|
|
|
|