Networking General

What is public and private IP address? – Real Scenarios

Public and private IP address explanation with example and real time scenarios. Public IP Address: Public IP Address is the IP that is unique and visible to the world. For example, “interviewsansar.com” website has a unique public IP address. Actually, Public IP addresses are registered by Internet standards groups e.g. NIC (Network Information Centre) and […]

Can TCP IP socket server and client run on same machine?

Answer: Yes, TCP/IP socket server and client applications can be executed on the same machine. TCP Client and server programs are two different and independent application. Just tcp client has to connect to correct address of the tcp server. It doesn’t matter if we are running tcp socket client program on same machine on which […]

Tell me some situations where you have used socket in your project?

Answer: To answer this question, focus on your projects where you have used socket and I would recommend to make a note of all socket used situations. Some times in interview, on the fly we may not able to recollect many situations. If you quickly states many situations it gets interviewer, a confidence on your […]

What does bind() function do in TCP/UDP server?

Answer: Bind() function in socket programming is used to associate the socket with local address i.e. IP Address, port and address family. int bind(int sockfd,struct sockaddr *servaddr,int addrlength); There could be many combination of IP address and ports e.g. (10.17.18.19, 6400), (10.17.18.19, 6500), (10.17.18.19, 6600) and so on, a server can use. Let’s say we […]

Scroll to top