|
|
|
|
|
|
|
|
|
|
- Reading the port number
- Required permissions
SocketClientInfo (Function) In french: SocketClientInfo Allows the server to get information about the current client socket. The current client socket corresponds to the last socket whose message was read by SocketRead. This function can be used on a server of sockets. This makes it possible to determine whether a user has connected via the socket and thus check the validity of the connection. Remarks: - UDP sockets: Allows the server to obtain information about the socket whose last message was read using SocketRead.
To use sockets on the server, you need to check the "Allow server sockets" option in the "Advanced" tab of the WEBDEV administrator.
Reminder: A socket is a communication resource used by applications to communicate from one computer to another regardless of the type of network.
TableAdd(TABLE_IncomingMsg, "1" + TAB + SocketRead("Server", False) + ...
TAB + SocketClientInfo("server", SocketAddress) + ...
TAB + SocketClientInfo("server", SocketPort))
EDT_SentenceReceivedFromComputerB = SocketRead("ComputerA", False, 2000)
IF EDT_SentenceReceivedFromComputerB <> "" THEN
Info("Message received from the IP address # " + SocketClientInfo("ComputerA", SocketAddress))
END
Syntax
<Result> = SocketClientInfo(<Socket name> , <Type of information>)
<Result>: Character string - Requested information.
- Empty string in case of problem.
<Socket name>: Character string Socket name defined on the server. This name is defined using SocketCreate (for a simplified server) or SocketAccept (for a standard server). <Type of information>: Integer constant Information to retrieve: | | | SocketAddress | IP address of the client socket. | | SocketPort | Port number to which the socket is connected. |
Remarks When a server is created on a port, a communication channel is created for each new connected client. This communication channel uses a port, chosen by the system among the available ports. SocketClientInfo returns the port number used by the communication channel. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|