TCP client and server

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 […]

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. (, 6400), (, 6500), (, 6600) and so on, a server can use. Let’s say we […]

Scroll to top