Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Echo client program: (4 Items)
   
Echo client program  
I've written a small program serving as a echo client. The host is on windows XP using momentics version 4.5 as 
development env. The target is running on a QEMU emulator (x86). 

The client program is connectiing to a echo server running on the host and is working as expected. It can perfectly 
recover when I terminate and restart the echo server. However this is only the case when starting from within the 
development environment. When I start up the client on the QEMU emulator the client program exits without any message 
when the echo server disconnects. No message, no signal, nothing.....
I'm getting deperate since there is no way to debug this behaviour

I've attached the example I'm using for testing. 

Hope someone can help

regards Wim

 

Attachment: Text example.cpp 2.44 KB
Re: Echo client program  
On Fri, May 08, 2009 at 08:25:25AM -0400, Wim Hellenthal wrote:
> I've written a small program serving as a echo client. The host is on windows XP using momentics version 4.5 as 
development env. The target is running on a QEMU emulator (x86). 
> 
> The client program is connectiing to a echo server running on the host and is working as expected. It can perfectly 
recover when I terminate and restart the echo server. However this is only the case when starting from within the 
development environment. When I start up the client on the QEMU emulator the client program exits without any message 
when the echo server disconnects. No message, no signal, nothing.....
> I'm getting deperate since there is no way to debug this behaviour
> 
> I've attached the example I'm using for testing. 
> 
> Hope someone can help
> 
> regards Wim
> 

Are you sure you aren't getting hit with a SIGPIPE?
Try setting signal(SIGPIPE, SIG_IGN);

-seanb
Re: Echo client program  
Sean,

signal(SIGPIPE, SIG_IGN) solved the problem. thank you! 

regards Wim
Re: Echo client program  
> On Fri, May 08, 2009 at 08:25:25AM -0400, Wim Hellenthal wrote:
> > I've written a small program serving as a echo client. The host is on windows XP using momentics version 4.5 as 
development env. The target is running on a QEMU emulator (x86). 
> > 
> > The client program is connectiing to a echo server running on the host and is working as expected. It can perfectly 
recover when I terminate and restart the echo server. However this is only the case when starting from within the 
development environment. When I start up the client on the QEMU emulator the client program exits without any message 
when the echo server disconnects. No message, no signal, nothing.....
> > I'm getting deperate since there is no way to debug this behaviour
> > 
> > I've attached the example I'm using for testing. 
> > 
> > Hope someone can help
> > 
> > regards Wim
> > 
> 
> Are you sure you aren't getting hit with a SIGPIPE?
> Try setting signal(SIGPIPE, SIG_IGN);
> 

And check the return value from send().

-seanb