Tuto WINDEV 25
Part 7: Advanced programming 419 ▶ Let’s study the processes performed by the client (computer B). 1. Display the code of "Connect" button found in the "Computer B" area: • Select the "Connect" button. • Press F2 to display the events. 2. In the "Click" process, you will see SocketConnect , which is used to connect to the socket created by computer A. Close the code editor. 3. Display the code of "Send" button found in the "Computer B" area: • Select the "Send" button. • Press F2 to display the events. 4. The following code is used in the "Click" event: IF NOT SocketWrite("ForComputerA", ... EDT_SentenceToSendToComputerA) THEN Error(ErrorInfo(errMessage)) RETURN END You will notice the presence of SocketWrite that is used to send a message onto the socket to which computer B is connected. Close the code editor. Remark: In this lesson, we have seen a "simple" communication between a server and a client computer: the client sends messages and the server processes the messages. You have the ability to create more complex applications. You have the ability to establish a communication between two applications, both client and server. In this case, the management of threads becomes very important to manage the send operations and the responses.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==