Hello Experts,
My Doubts:
1) I have heard that Socket is an endpoint residing on the host. If so then how a socket is uniquely identified?
2) Can this endpint communicate with multiple sockets on remote hosts?
Hello Experts,
My Doubts:
1) I have heard that Socket is an endpoint residing on the host. If so then how a socket is uniquely identified?
2) Can this endpint communicate with multiple sockets on remote hosts?
1) by it's handle
2) yes.
Most sockets are represented by an int, which is then passed to functions that connect/send/receive/perform other operations on it. The actual socket itself is a structure, but the user never sees that part.
That depends on the type of socket, but usually yes.
There are two types of scokets:
1) TCP socket: multiple sockets can be bound to a single port in this case. These are the ESTABLISHED or Active Sockets , the ones which are Exchanging the data. The Other Type of TCP socket is a passive socket which listens to incoming connections and only one PASSIVE Socket can be bound to a port. (on the contrary multiple ACTIVE sockets can be bound to a same port)
2) UDP Socket: It is a socket which will itself handle all the data by itself serially, destined to itself (on the contrary TCP socket will spawn a new ACTIVE socket to handle the new incoming Clients.
Not sure why you're telling us, you're the one asking the questions.
Either way, there's many different types of protocols (TCP/UDP being some of them), but three different types of sockets. Raw (packet) sockets that send data as it is gotten from the user, datagram sockets that encapsulate the data in datagrams ( UDP uses this ), and connected sockets which rely on a handshake system (TCP).
Probably right - the OP is nothing but a serial quiz question robot.
Search Results - C Board
Post code, or leave town.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.