PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Different possibilities
  • Modifying the standard behavior of sockets
  • Optimizing the network frames
  • Optimizing the connections for an IP address
  • Re-using an address that is already used
  • Using the default settings
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
Managing sockets with WINDEV, WEBDEV and WINDEV Mobile
Overview
WINDEV, WEBDEV and WINDEV Mobile include several functions allowing you to perform an advanced management of sockets.
A socket is a communication resource used by the applications to communicate between computers regardless of the network type.
This communication mode can be used, for example, to establish a communication between computers connected by Internet.
Windows Mobile The exchange of data between two computers can be performed:
  • by Wi-Fi.
  • by infrared.
  • by ActiveSync.
  • by GPRS (caution: some phone services do not allow to establish a connection between two computers).
  • by network card.
WINDEV, WEBDEV and WINDEV Mobile allow you to manage:
  • The standard sockets
  • The UDP sockets
  • The sockets by infrared
  • The SSL sockets
Examples for using sockets:
  • managing a messaging in real-time
  • accessing a news server (forum)
Versions 17 and later
iPhone/iPad This feature is now available for the iPhone/iPad applications.
Universal Windows 10 App This feature is now available for the Windows Phone applications.
New in version 17
iPhone/iPad This feature is now available for the iPhone/iPad applications.
Universal Windows 10 App This feature is now available for the Windows Phone applications.
iPhone/iPad This feature is now available for the iPhone/iPad applications.
Universal Windows 10 App This feature is now available for the Windows Phone applications.
Versions 23 and later
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
New in version 23
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Different possibilities
A WINDEV or WEBDEV application can manage the sockets according to different modes:
Modifying the standard behavior of sockets

Optimizing the network frames

By default, in Windows, the network frames are optimized according to the Nagle algorithm.
To communicate with a system that does not support this optimization (some embedded industrial operating systems for example), this optimization must be disabled.
To do so, enter the following code:
Socket.Option = SocketNagleOff
WINDEVWEBDEV - Server codeWindows Mobile

Optimizing the connections for an IP address

When an IP address is passed to SocketConnect, you have the ability to optimize the connection by using the following code:
Socket.Option = SocketOptimizeIPConnection
This option is not enabled by default because the connection may fail in some configurations. However, it may be useful in some applications for which the performances are critical.

Re-using an address that is already used

By default, SocketCreate allows you to re-use an address that is already used (by the application itself or by another application). To forbid this operating mode, type the following code line:
Socket.Option = SocketNoReuseAddress
Note: By extension, this option allows you to find out whether an address or a port is already used. In this case, SocketCreate returns an error.

Using the default settings

The following code allows you to restore the default setting:
Socket.Option = SocketOptionDefault
Related Examples:
WD Live Messaging Complete examples (WINDEV): WD Live Messaging
[ + ] This example presents the "Socket" functions of WINDEV.
The following topics are presented in this example:
1/ How to connect to a socket
2/ How to create a socket
Summary of the example supplied with WINDEV:
This example present the different functions for socket management supplied with WINDEV. To use this example, a list of contacts must be entered in your address book. The contacts must be identified by a name and the IP address of their computer. When the application is started, the program searches for the accessible contacts (which means the ones who have started this application on their computer). When you double-click a "connected" contact, a discussion window is opened, giving you the ability to communicate with the contact
WD Using sockets Training (WINDEV): WD Using sockets
[ + ] This example presents the use of the "Socket" functions of WINDEV in Client/Server.
The following topics are presented in this example:
1/ How to connect to a socket
2/ How to accept a request for connection
3/ How to write or read on a socket
Summary of the example supplied with WINDEV:
This example presents the different functions for socket management supplied with WINDEV. To use this example, a first instance of the example must be started in "server" mode. Then, by specifying the name of the computer that will be used as server and a nickname, you can connect to this application in "client" mode. You now have the ability to send messages to all the connected users. In this example, a thread and a socket are associated with each connection.
WD Sockets Sample components (WINDEV): WD Sockets
[ + ] This example proposes a component allowing two applications to communicate by using sockets.
WD Trace Socket Sample components (WINDEV): WD Trace Socket
[ + ] The purpose of this example is to trace everything that occurs on a communication via socket, on a specific address, on a specific port. This example allows you to understand the principle of dialog via socket between two applications.
Therefore, in the applications that dialog via socket, even if no trace option as implemented by the developers, you will have he ability to view all the exchanges performed on the socket.
This example also enables you to understand the operating mode of the network protocols based on the sockets: POP3, SMTP, FTP, HTTP, and so on.
Note for the users who are experienced in network communication:
This example does not allow you to trace the UDP packages (only the TCP communications can be traced).
WD Video surveillance Complete examples (WINDEV): WD Video surveillance
[ + ] This example explains how to broadcast images coming from a Web camera via a network (Intranet, Internet).
The following topics are presented in this example:
1/ Web Camera control
2/ Using the Socket functions
3/ Using the Thread function
4/ Detecting movements
Summary of the example supplied with WINDEV:
This example is used to broadcast the images captured by a Web Camera via a network (Intranet, Internet)
This application groups the "Diffusion server" part and the "Monitor" part.
It allows you to:
- broadcast the images of the Web Camera
- select a "monitor"
- analyze the image to detect a movement. In this case, the relevant recipients (or "monitors") can be notified
- connect up to 8 different Web Cameras and enable the detection of movements
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment