Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Quoted
Originally posted by tbscope
When you use TCP, it's easy.
If a socket gets closed in the proper way, a message is sent to the other side to say: "Hey, I'm gone, see you later".
This can be done by the server, but also the client. So when the client closes it's connection, the server will see this.
Quoted
I don't really know how this is done with UDP though.
Quoted
But, problems will occure when the socket isn't closed in the proper way. With this I mean, the client didn't say to the server "I'm gone". This can happen for example when the connection of the client pc is suddenly broken.
Quoted
For example, regularly probe the client (send something to it) to see if it's still alive.
Quoted
But the best way to solve it, is in my opinion, to work with timeouts.
If you're sending something, and it takes too long to send a block of data, create a send timeout, and close the socket.
Quoted
This is how most ftp, http, nntp, etc... servers work.
The client just has to reconnect again.
Quoted
Originally posted by Tom
I thought that there might be a similiar way if a client crashes...I cannot create too much traffic, that's the problem.
Quoted
UDP isn't a connection protocol - you don't have a "connection" here, so you don't have to (and even don't have the ability to) close it. UDP is datagram based, it just sends some data, but doesn't assure that it reaches destination at all, and even if it does, it doesn't assure that datagrams don't get mixed, cut, reordered...
Quoted
Originally posted by tbscope
Yeah...
but this is such a case where one definition of a word means something completely different than another definition.
I understand with connection the actual communication link between two computers for example.
If I want to listen in on a radio or television stream, I connect to that stream, otherwise, I will not hear or see anything.
I don't have to tell that stream "Hey, I'm ..., I would like to listen to you", I just connect.

Quoted
Originally posted by wysota
As for the original problem, as I said, POSIX sockets notify the server by sending 0 bytes through the socket when the connection is interrupted (it is like "broken pipe" - I'm listening, but noone is talking), it is possible that Qt gives a simmilar behaviour.
This post has been edited 1 times, last edit by "wysota" (Aug 17th 2004, 5:26pm)
This post has been edited 1 times, last edit by "djanubis" (Aug 17th 2004, 8:47pm)