Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Oct : Indy9 server problem
| Subject: | Indy9 server problem |
| Posted by: | "York" (offi..@onlinebg.info) |
| Date: | Fri, 28 Oct 2005 15:59:08 |
Hello
I am using Indy9. I have the following problem:
I've made a simple lan chat application
I have several IdTCPClients connected to one IdTCPServer (running in LAN).
When a client sends a buffer to the server the server sends back this data
to all the other clients connected to it. I use thread locking so in this
aspect everything is OK. (my writing is safe).
However I have the following problem which I do not know what is caused by
and how to solve it:
If unplug the network cable of one of the clients (while connected) and at
the same time if another client tries to send a message the server stops
responding for about 20 seconds and then sends that message to all the
others.
When I debugged this I noticed that it gets stuck on the following:
for i := 0 to ml.Count - 1 do
begin
member := TClientThread(ml.Items[i]);
Member.Connection.WriteBuffer(memStr.Memory^, memStr.Size);
//PROBLEM HERE
end;
i.e. when trying to write data to the client which cable is unplugged.
Please tell me how to handle this?
Thanks