Polling on socket descriptor does not return pollhup
I have a query related to the functioning of poll() system call on solaris and linux platforms.
When the client is abnormally terminated, it is observed that on Linux the socket is immediately closed and the server gets ECONNREFUSED.
But in case of Solaris it is observed that the socket is not closed immediately but waits until timeout happens and server shows EINPROGRESS rather than ECONNREFUSED.
I have the following code to poll on the socket-
When the other end of a FIFO closes socket descriptor, poll() doesn't return with POLLHUP set in revents. Instead it keeps waiting on Solaris till the timeout happens.
Is it the case that on Linux poll call will return POLLHUP and on Solaris it will not?
Last edited by Scott; 04-23-2010 at 03:30 AM..
Reason: Code tags, please...
HI
I need some help on this below one
Have summuary file coming on daily basis with list of file names and count ,if the summuary file not exist ,pool it for every 5 mins till it arrives .Once arrived remove first and last line from the file and check all the files in respective director all... (12 Replies)
I have BIND 9.8.1-P1 cache only DNS server running in Solaris 10. I have upgraded the same from 9.6.1 to 9.8.1-P1. Now i am facing "file descriptor exceeds limit (4096/4096)" error frequently on the server.
Please help me on this issue! (1 Reply)
Hi!
Im trying to make a program that polls a mysqlDB every 5 minutes.
the poll checks a scheduletable in the dB and exicutes a function if
there was a "go" in the scheduletable, and if it retrives a "no go" from the table
it should just wait for another 5 minutes before re polling the DB,
... (1 Reply)
I need clarification on whether it is okay to set socket options on a listening socket
simultaneously when it is being used in an accept() call?
Following is the scenario:-
-- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Hi,
I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime.
To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Hi all,
I have a directory where some process is keeping incremental/new log files. I need to code a program which will periodically poll this directory and if it founds a new file arrived then copy that new file to some other specific directory.
We are OK with this polling approach. I just... (3 Replies)
Hi,
I want to validate that a file is a socket file on Linux. I know I can do this using the S_ISSOCK macro, but I am not sure how to get the file descriptor for the socket file.
For example, I know that /tmp/mapping-foo is a socket file. In Python I can do something like this:
>>> import... (2 Replies)
Hi Friends,
I have written a program which will listener for more than 1000 requests per second from a single socket descriptor and then it will process those requestes. Its taking X amount of time. Now i want to reduce that time. Will I can write multiple threads to receive the... (2 Replies)
I have a server and client code.
My server says accept and my client says a connect.
After accept when i print inet_ntoa(cin.sin_addr) by running the client on same machine i get 127.0.01 but accept returns a zero. Now when i try to do a recv from the client the recv never waits for a send. It... (7 Replies)