Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TServerSocket OnDisconnect

Posted on 1999-10-08
8
Medium Priority
?
195 Views
Last Modified: 2010-05-18
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
Comment
Question by:mabell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2111216
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
 
LVL 13

Expert Comment

by:Epsylon
ID: 2111322
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
 

Author Comment

by:mabell
ID: 2111330
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:mabell
ID: 2111334
Ok thanks Epsylon .. post your comment as an answer and I will give you the points :-)
0
 

Author Comment

by:mabell
ID: 2111346
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
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2111368
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
 
LVL 13

Accepted Solution

by:
Epsylon earned 400 total points
ID: 2111396
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
 
LVL 1

Expert Comment

by:Moondancer
ID: 6854001
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question