PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Reading the port number
  • Required permissions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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 allows you to find out whether a user connected via the socket and to check the validity of connection.
Notes:
  • UDP sockets: Allows the server to get information about the socket whose last message was read by SocketRead.
  • WEBDEV - Server code To use the sockets on the server, check "Allow the server sockets" in the "Advanced" tab of the WEBDEV administrator.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Reminder: A socket is a communication resource used by the applications to communicate between computers regardless of the network type.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Android Widget This function is now available in Android Widget mode.
Example
// Add the incoming messages into a table
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 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 (with quotes)
Name of socket defined on the server. This name was defined by SocketCreate (for a simplified server) or by SocketAccept (for a standard server).
WINDEV Caution: The socket name is case sensitive.
<Type of Information>: Integer constant
Information to retrieve:
SocketAddressIP address of client socket.
SocketPortPort number to which the socket is connected.
Remarks

Reading the port number

When a server is created on a port, a communication channel is created for each new connected client. This communication channel is using a port, chosen by the system among the available ports. Therefore, SocketClientInfo returns the port number used by the communication channel.
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permission : INTERNET
This permission allows the applications to open the network sockets.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Java wd230java.jar
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment