Could you please check the following code

I normally don't review large chunk of code within free support. I usually do that when I have a consulting contract.

Could you please check the following code of both server and client procedures and tell me what is missing in order to be able to get the client number into the "DISPLAY" with the all other info.This is code writen by you i think. I have add few things and there might be mistakes.

I don't know what the "client number" is. If it is the index in the client[] property, then you are on the wrong track. That index vary as clients connects and disconnects ! The index may be used only in temporary operation will the list won't change, for example within the handling of an event. using the index on the long term is a bad idea.

In my opinion, each of your client should be assigned an unique ID, either sent my the client himself, or generated by the server (Simple incrementing number). The ID is somewhat necessary because you may have several client from the same computer and hence have the same IP for several clients. You could also use IP:Port as an ID.

As Marc told you, if you need to display a list of client, real time, you have to use the WSocketServer OnClientConnect and OnClientDisconnect events to add/:remove items to/from the list you use for display. in both events you have access to the client instalnce and can thus access PeerAddr, PeerPort and any other data you may have (One of the demo save the time of connection just for demo purpose).

The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to