Poll Results
No votes. Be the first one to vote.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In socket programming, the client must know the following information to successfully establish a connection to a server:
1. Server’s IP Address or Hostname: The client needs to know where the server is located in the network. This can be either an IP address (e.g., 192.168.1.1) or a domain name (e.g., http://www.example.com) that will be resolved into an IP address.
2. Port Number: The client must know the port number on which the server is listening for incoming connections. Ports are used to identify specific applications running on a server. For example, HTTP servers typically listen on port 80, while HTTPS servers listen on port 443.
3. Protocol: The client needs to know the protocol the server is using (TCP or UDP). This is because the socket API requires specifying the type of communication protocol during the socket creation process. TCP (Transmission Control Protocol) is reliable and connection-oriented, making it suitable for applications where data delivery is crucial (e.g., web servers, email). UDP (User Datagram Protocol) is a connectionless protocol that is used when speed is more important than reliability (e.g., live video streaming or online gaming).
Knowing these pieces of information, the client can create the appropriate socket and initiate a connection request to the server.
C. both ip address of server & port number