Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Socket deconnection: (3 Items)
   
Socket deconnection  
Hi
I have to manage a very busy socket in a client connection

I detect disconnection by testing the return value of the send() function 
int size_written = send( fd, .... , ....);
then i test the errno variable
	if (errno == ECONNRESET || errno == EPIPE)
	{
		fd = CODE_SOCKET_CLOSE;
		return CODE_DECONNEXION;
	}

The socket is used both in a thread for reading and 2 timers for writing

It work but when the socket trafic is increased and a server deconnection occured, for an unknown reason the the process
 is stopped. There is no error and no core dump. It's like an exit function call

 Thank for your answer
Re: Socket deconnection  
Try:
signal(SIGPIPE, SIG_IGN);

Sent from my BlackBerry 10 smartphone on the Rogers network.
From: Gervot Olivier
Sent: Wednesday, April 17, 2013 8:28 AM
To: general-networking
Reply To: general-networking@community.qnx.com
Subject: Socket deconnection


Hi
I have to manage a very busy socket in a client connection

I detect disconnection by testing the return value of the send() function
int size_written = send( fd, .... , ....);
then i test the errno variable
if (errno == ECONNRESET || errno == EPIPE)
{
fd = CODE_SOCKET_CLOSE;
return CODE_DECONNEXION;
}

The socket is used both in a thread for reading and 2 timers for writing

It work but when the socket trafic is increased and a server deconnection occured, for an unknown reason the the process
 is stopped. There is no error and no core dump. It's like an exit function call

Thank for your answer




_______________________________________________

General
http://community.qnx.com/sf/go/post100676
To cancel your subscription to this discussion, please e-mail general-networking-unsubscribe@community.qnx.com
Attachment: HTML sf-attachment-mime11706 3.17 KB
Re: Socket deconnection  
IT WORK!
Thanks for your good answer!!