How socket, port and bind() behave?

I have some questions about C++ socket programming(Linux). please help to dig deep

1.Are there one file descriptor per each port in OS level.
2.How do multiple ports use same network interface? is it switching like threads in processor? so, if number of using ports increase, can it be delayed data for specific port?
3. What happens in OS level when creates a socket? does is create any reference to IO file descriptors?
4. Then what happens in OS level when calls bind(). how it interconnect socket and NIC address?
5. What happens when use reusable socket? How multiple sockets bind to one port? do those switching on one port like threads?
6. when sending or receiving without bind() to specific address or port? How and what is the logic OS select a address and a port.
Last edited on
Those are loaded questions and you're better off starting with some basic socket tutorials. IBM has a page explaining them well but it's pretty technical (for me).
http://www.linuxhowtos.org/C_C++/socket.htm
Topic archived. No new replies allowed.