WINDEV Concepts

Part 6: Communication 177 Managing sockets WINDEV includes advanced socket management functions. A socket is a communication resource used by applications to communicate between two computers regardless of the type of network. This communication mode can be used, for example, to establish a communication between computers connected by Internet. Different modes WINDEV applications can manage sockets according to different modes: • WINDEV Client application : the application connects to any server and exchanges data via a socket. • WINDEV "Simplified server" application : the WINDEV application is a server that exchanges information via a socket with a single client computer. • WINDEV "Standard server" application : the WINDEV application is a server that exchanges information via a socket with multiple client computers. How a client application works A client application of a socket server connects to a standard server to exchange information via a socket. Example: AWINDEV client application can connect to a standard news server on the Internet . Step 1: Connecting to the server To connect to a server socket, use SocketConnect . This function makes a connection request to the server. The socket is identified by its port and address. Step 2: Exchanging data Once two machines have connected their sockets, a communication channel is established between them. These two machines can read from and write character strings to the socket. To read from and write to the socket of the server, the WINDEV client application must use SocketRead and SocketWrite . Step 3: End of communication To end the communication, close the socket from the client machine with SocketClose .

RkJQdWJsaXNoZXIy NDQ0OA==