[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

TServerSocket OnDisconnect

Hello all,  I have made a list of all user (Ip addr) connected on the server in a listbox and when one of them disconnect I want to know which one (exacly) to delete it from the list. How do I do this?
Thanks
0
mabell
Asked:
mabell
1 Solution
 
intheCommented:
Hi
ping the ip address and the one that not there delete from listbox..
get ping compoenent from http://www.rtfm.be/fpiette/indexuk.htm 

Regards Barry
0
 
EpsylonCommented:
OnConnect and OnDisconnect have a Socket parameter. In your OnConnect event store Socket.SocketHandle in the userlist. In the OnDisconnect event search the userlist for the matching Socket.SocketHandle and delete that user from the list.

0
 
mabellAuthor Commented:
It's a good way but what if the client stay on the Net after disconnecting to the server (the server is my app) ?? Does it have a code that I can put in the TServerSocket.OnDisconnect event to determine which socket have been disconnected ?? If yes ...
Thanks :-)
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
mabellAuthor Commented:
Ok thanks Epsylon .. post your comment as an answer and I will give you the points :-)
0
 
mabellAuthor Commented:
Sorry inthe but the client may stay on the Net after disconnecting from my server
so your solution doesn't work for me.
thanks
0
 
DrDelphiCommented:
Why don't you have a thread polling the connections and delete the client from the listbox if they drop from one pass to another?
0
 
EpsylonCommented:
Ok, here is the answer again:

OnConnect and OnDisconnect have a Socket parameter. In your OnConnect event store Socket.SocketHandle in the userlist. In the OnDisconnect event search the userlist for the matching Socket.SocketHandle and delete that user from the list.


Thanks for the points Mabell   :o)

Cheers,

Epsylon.
0
 
MoondancerCommented:
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp

For experts interesting in helping the cleanup effort in their respective TAs, this link please:
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now