• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
socket() returning same value in shared library ( wasRe: accept() hangs)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

socket() returning same value in shared library ( wasRe: accept() hangs)


  • Subject: socket() returning same value in shared library ( wasRe: accept() hangs)
  • From: Ken Baer <email@hidden>
  • Date: Mon, 10 Oct 2005 11:29:09 -0700

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?

On Oct 9, 2005, at 3:50 PM, Ken Baer wrote:

I am trying to set up communications between a server and a client.  My
client calls connect(), and my server is getting an Accept message and
calls accept() with the SOCKET it got from the message callback.  Then
accept() hangs.  On the client side, connect() returns 0 and the
program continues, even before accept() is called on the server side.

The socket values seem correct, but I don't understand the behavior.
If I run the client without the server, the connect() fails as I would
expect it to.

I don't understand why accept() would hang in this situation.

-Ken Baer. Hash, Inc. email@hidden

_______________________________________________
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


  • Follow-Ups:
    • Re: socket() returning same value in shared library ( wasRe: accept() hangs)
      • From: "Justin C. Walker" <email@hidden>
    • Re: socket() returning same value in shared library ( wasRe: accept() hangs)
      • From: Josh Graessley <email@hidden>
    • Re: socket() returning same value in shared library ( wasRe: accept() hangs)
      • From: Frederick Cheung <email@hidden>
References: 
 >accept() hangs (From: Ken Baer <email@hidden>)

  • Prev by Date: Re: accept() hangs
  • Next by Date: Re: socket() returning same value in shared library ( wasRe: accept() hangs)
  • Previous by thread: Re: accept() hangs
  • Next by thread: Re: socket() returning same value in shared library ( wasRe: accept() hangs)
  • Index(es):
    • Date
    • Thread