PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Example: Reading messages in a thread
SocketRead (Example)
Example: Reading messages in a thread
The following code corresponds to the code run by a thread for receiving the messages sent to a socket.
sMessage is Buffer // Message currently received
// Permanently wait for the messages with locking listening
LOOP
// Read the messages asking for connection (locking operation)
sMessage = SocketRead(csSocketRequestName, False, 50)
// Is the message a connection request
IF sMessage ~= csREQ THEN
    // Inform the user
    Message("A connection request was received")
    // Listen to the request
    ListenStartMessageRequest()
    // Clear the content of the status bar
    Message("")
END
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment