WD12 Socket events / Socket help

Startbeitrag von Ian am 01.05.2009 04:57

Hi All. I'm from a VB6 / .net background (we can't all be perfect ! ), have purchased WinDev12 and am trying to create a TCP/IP server/client app.
My issue is I don't seem able to 'trap' or obtain the socket status (free, connecting, connected, disconnecting ,disconnected etc...).

In VB (sorry!) I'd use the winsock eventhandler. This would fire each and every time a change in socket status was detected... Is there a way to do this with WinDev please ?

I have worked my way through the manuals / examples but can't get my head around the socket / connection objects..

I hope someone can help a rather frustrated newbie... Thanks.

Antworten:

Hi,

A complete example can be found in the complete examples section: "Using sockets" .Based on this example I managed to create a client-server app.

Basically Windev uses a procedure with a continuous loop to check the socket status.
This procedure is run as a thread.

Looking at the client window in the example:
The procedure containing the loop is called "Reception".
In the initialization code of WIN_Client the connection is made and at the end the thread is started.

HTH, regards,
Piet

von Piet van Zanten - am 01.05.2009 07:43
Many thanks for that. Much clearer now. Coming from a VB6 background, I had not fully understood :rolleyes: the power / use of 'Threads' within my code... Appreciated.

von Ian - am 01.05.2009 09:50
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.