Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
dup() & sockets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dup() & sockets



I havent found any information about this so I thought I would ask the
experts here.

Our application use a raw ethernet socket for device communication. The
socket is opened using MoreAuthSample.

If I need more than one socket, for example one per ethernet port, can I
dup() the one returned from the authenticated process and use it separately?

Here is why I think this could work:
1. Acquire the socket using the authenticated process
2. dup() the socket to a new fd
3. bind() the new socket to an ethernet port
4. repeat dup() and bind() for each ethernet port

Because bind is a separate step from acquiring the socket it seems like
this might work. However, I imagine that I have to go back to the well
for additional sockets.

Thanks for clarifying this idea,

...Duane
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.