Skip to contentSkip to conversation

send() from realtime task causes program shutdown

Xenomai-help Frits de Klark 2 participants 3 messages Nov 1, 2006 – Nov 2, 2006

lore
Share & tools
lore
#0 lore raw

Hello everyone,

another question from me. Right now I have a very simple (and dirty) server program which listens for an incoming tcp connection, then starts a realtime task which sends a string to the connected client periodically. This all works fine, until I close the connection from the client side; In that case my server program just shuts down. It just returns to the command prompt (from where I started the server program) without any messages.

I noticed that this happens when my realtime task calls send() to send the string to the client. I do check on send() for a return value, but it looks like the program quits before this return value can be checked (i.e. somewhere during the send() call).

Does anyone has any idea where this behaviour might come from?

Thanks very much.

Best regards,

Frits

#1 lore raw
Quoted 10 lines · Frits de Klark

Hello everyone,

another question from me. Right now I have a very simple (and dirty) server program which listens for an incoming tcp connection, then starts a realtime task which sends a string to the connected client periodically. This all works fine, until I close the connection from the client side; In that case my server program just shuts down. It just returns to the command prompt (from where I started the server program) without any messages.

Quoted 5 lines

I noticed that this happens when my realtime task calls send() to send the string to the client. I do check on send() for a return value, but it looks like the program quits before this return value can be checked (i.e. somewhere during the send() call).

The sender may receive SIGPIPE. Run your application over GDB to verify that.

Quoted 11 lines

Does anyone has any idea where this behaviour might come from?

Thanks very much.

Best regards,

Frits
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.
#2 lore raw
Quoted 18 lines · Philippe Gerum
Quoted 10 lines · Frits de Klark

Hello everyone,

another question from me. Right now I have a very simple (and dirty) server program which listens for an incoming tcp connection, then starts a realtime task which sends a string to the connected client periodically. This all works fine, until I close the connection from the client side; In that case my server program just shuts down. It just returns to the command prompt (from where I started the server program) without any messages.

Quoted 5 lines

I noticed that this happens when my realtime task calls send() to send the string to the client. I do check on send() for a return value, but it looks like the program quits before this return value can be checked (i.e. somewhere during the send() call).

Quoted 6 lines

The sender may receive SIGPIPE. Run your application over GDB to verify that.

Philippe.

This was indeed the case. I'm sorry to ask such a (afterwards) trivial question. I couldn't remember it happened to me ever before, so I assumed it had something to do with Xenomai. As it turns out, it doesn't.

Thanks a lot!

Frits