

Hi, all,

I have 2 questions about signal handling in R. Would you pls help give me
some suggestions? Many thanks!

[How to block the signal in one R function]:
If one R function hopes to be running without interrupting, how can we
avoid this?
To be more specific, for one R function "func1", it will do a loop to send
messages to another R process, and receive responses from peers. How can we
avoid users interrupt this function by pressing "Ctrl+C", so that it can
finish normally, without messing up the message protocol? Are there any way
to block signal handling within the function?

[why writing to one broken connection for the 3rd time will hang, instead
of getting exceptions]:
Such as, there is one broken socket connection (in blocking mode), which is
closed by peer by calling "close(conn)".
The 1st write will return. The 2nd write will get an exception. The 3rd
write will hang there forever.
How can users always get an exception or other error messages when writing
to a broken connection, instead of possibly hanging there?

> writeBin(as.integer(1), con, endian="big");
> writeBin(as.integer(1), con, endian="big");
Error in writeBin(as.integer(1), con, endian = "big") :
  ignoring SIGPIPE signal
> writeBin(as.integer(1), con, endian="big");  ----- hanging


=====================

Rong "Jessica", Li
Platform Symphony TET, CSTL, IBM Systems &Technology Group, Development
Tel:86-10-82451010  Email:ronglli@cn.ibm.com
	[[alternative HTML version deleted]]

