Re: socket() returning same value in shared library ( wasRe: accept() hangs)
Re: socket() returning same value in shared library ( wasRe: accept() hangs)
- Subject: Re: socket() returning same value in shared library ( wasRe: accept() hangs)
- From: Josh Graessley <email@hidden>
- Date: Mon, 10 Oct 2005 11:42:50 -0700
The return value of the socket call is just a file descriptor. Every
process has it's own table of file descriptors. Your code should not
care about the "value" of the file descriptor. It's value can not be
interpreted as a number. It is simply a reference to an open resource
specific to that process.
-josh
On Oct 10, 2005, at 11:29 AM, Ken Baer wrote:
I am porting a suite of WinSock based applications. We are using a
socket wrapper class that is in a shared Dynamic library. Right
now the server is running on a PC, but the Messenger and Slave are
running on a Mac (at the same time). The Messenger talks to the
server, and passes information back and forth between the Server
and the Slave. Messenger and Slave are sharing the same dynamic
library that makes all the calls to BSD socket functions.
I think the reason that the call to accept() called from the
Messenger is that the SOCKET value is the same from the listening
socket on the Messenger and the messenger socket that the Slave
tries to connect with. What's happening is that the BSD function
socket() is returning the same value (42) in the same dynamic
library when called from 2 different applications. They are booth
open.
Is there a way to insure that socket() returns a unique number in a
shared library environment?
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden