I’m creating a socket table from a network composed of 2 hosts. They have a p2p connection and they’re working with tcp protocol. Do I have to create a welcoming socket in both of the hosts (as they act like servers)? And a receiving socket as well as a sending socket for each host? Or just one for sending/receiving would be ok?
Share
Each host will need a listening socket on which it will accept new connections. It will also need one socket for each inbound TCP connection (returned from the
acceptcall when it accepts an inbound connection) and one for each outbound TCP connection (returned from thesocketcall before callingconnectto make the outbound connection).