bad file descriptor when using recvmsg and multithreading

Hello all,
I am trying to get a program multithreaded, but am having a problem when I get to the recvmsg call. It keeps saying that the socket I am trying to use is a bad file descriptor. I have tested the function non-multithreaded, and it works fine. I am calling the object function from within a static void function (as is required for pthread_create) and from what I have traced, the fd doesn't change through all the redirection. What I was wondering is, can only the object that created the socket use it? or is it pretty much open to all the processes/threads that know that it is there. Any help or comments will be much appreciated =)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!