10-20-2010
Share socket fd between two processes
Hello every one i am implementing client server program.To handle multiple fds of client in server i used poll function.But this poll not able to access socket fd from other process.How can i share socket fd between two process.
Please Help me,Thanks in advance.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Is there a way to monitor certain processes and if they hang too long to kill them, but certain scripts which are expected to take a long time to let them go?
Thank you
Richard (4 Replies)
Discussion started by: ukndoit
4 Replies
2. Solaris
Hi
Is there an easy way to identify and group currently running processes into OS processes and APP processes. Not all applications are installed as packages.
Any free tools or scripts to do this?
Many thanks. (2 Replies)
Discussion started by: wilsonee
2 Replies
3. UNIX for Advanced & Expert Users
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)
Discussion started by: chandrutiptur
0 Replies
4. Programming
Hi all,
On the server side, one socket is used for listening, the others are used for communicating with the client.
My question is: if i want to set option for socket, which socket should be set on?
If either can be set, what's the different?
Again, what's the different if set option... (1 Reply)
Discussion started by: blademan100
1 Replies
5. Programming
Why does this socket function only read the first 1440 chars of the stream. Why not the whole stream ? I checked it with gdm and valgrind and everything seems correct...
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include... (3 Replies)
Discussion started by: cyler
3 Replies
6. Programming
Dear Experts,
i am compiling my code in suse 4.1 which is compiling fine,
but at runtime it is showing me for socket programming error no 88
as i searched in errno.h it is telling me socket operation on non socket,
what is the meaning of this , how to deal with this error , please... (1 Reply)
Discussion started by: vin_pll
1 Replies
7. Linux
Hello every one i am implementing client server program.To handle multiple fds of client in server i used poll function.But this poll not able to access socket fd from other process.How can i share socket fd between two process.
Please Help me,Thanks in advance. (1 Reply)
Discussion started by: andrew.paul
1 Replies
8. IP Networking
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)
Discussion started by: jake24
2 Replies
9. Programming
Hello guys!
I had seen some posts at this forum talking about my problem, but maybe my scenario is a little different, and I want other solutions.
I saw users of this forums saying that the way to shared sockets is using UNIX Sockets, but this is the only way in my scenario?
My Scenario:... (4 Replies)
Discussion started by: serpens11
4 Replies
10. Shell Programming and Scripting
Input data:
read1_data1
read1_data1
read2_data1
read3_data1
read4_data1
read4_data1
read4_data1
read5_data1
.
.
Desired output result:
read1_data1
read1_data2
read2_data1
read3_data1
read4_data1 (3 Replies)
Discussion started by: perl_beginner
3 Replies
LEARN ABOUT DEBIAN
explain_poll_or_die
explain_poll_or_die(3) Library Functions Manual explain_poll_or_die(3)
NAME
explain_poll_or_die - wait for some event on file descriptor and report errors
SYNOPSIS
#include <libexplain/poll.h>
int explain_poll_or_die(struct pollfd *fds, int nfds, int timeout);
int explain_poll_on_error(struct pollfd *fds, int nfds, int timeout);
DESCRIPTION
The explain_poll_or_die function is used to call the poll(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_poll(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_poll_on_error function is used to call the poll(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_poll(3) function, but still returns to the caller.
fds The fds, exactly as to be passed to the poll(2) system call.
nfds The nfds, exactly as to be passed to the poll(2) system call.
timeout The timeout, exactly as to be passed to the poll(2) system call.
RETURN VALUE
The explain_poll_or_die function only returns on success, see poll(2) for more information. On failure, prints an explanation and exits, it
does not return.
The explain_poll_on_error function always returns the value return by the wrapped poll(2) system call.
EXAMPLE
The explain_poll_or_die function is intended to be used in a fashion similar to the following example:
int result = explain_poll_or_die(fds, nfds, timeout);
SEE ALSO
poll(2) wait for some event on a file descriptor
explain_poll(3)
explain poll(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2010 Peter Miller
explain_poll_or_die(3)