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…

Read the full article

What header files and libraries do you include for socket programming?

Answer: Below is the header files and pakage mentioned with respect to language/platform. Java: C# C/C++ Windows WinCE C/C++ Linux   Note: This Question & answers sound simple but in interview many people forget it. Generally, it is asked to fresher but it is also asked to experience people too.

What is static and dynamic IP address?

Static and dynamic IP address concept is important when we work on network related stuff / programming, for example Wi-Fi, Ethernet etc. Answer: Static and dynamic IP Address: Static IP Address: A static IP address is a fixed IP address that is manually assigned to a computer or a device on a network. Static IP…

Read the full article

Can multiple TCP Servers run with same IP Address on a host?

Answer: Yes, we can create multiple TCP/IP servers using the same IP address on a machine. Actually, a tcp socket server is identified by unique combination of an IP address and a Port number. And, we can have many combinations of an IP address and Port numbers.   NOTES:  It is important to note that…

Read the full article

What is ping command in networking?

Answer: Ping command in networking is a frequently used command to test if an IP Address or domain name exist in the network. Ping is a tool, a software utility that is used to verify that a particular IP address e.g “10.17.18.97” or domain name e.g. “interviewsansar.com” exist into the network and can accept requests.…

Read the full article

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…

Read the full article

Where have you used UDP Socket Programming?

Answer: The answer is up to you if you have used UDP socket programming in your project. If you have not used in your project or you are a fresher, then you can say that you have not used, but you can answer the concept where we can use upd socket programming in real time…

Read the full article

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…

Read the full article

What are issues if we mix new and free in C++?

Answer: new and free in c++ should never be mixed or else we may get memory leak issues and resource leak issues and may take extra effort and time to maintain the C++ software project.Memory leak really a not a good elements for software and cause poor performance to a software.   Recommended to read…

Read the full article

Code for C++ delete singleton instance

Answer:To delete singleton instance or object in C++ programs, we need to follow a proper design to delete singleton object in the class . Especially, when multiple users are using object of singleton class in c++ program. One of the bad situations we can think that what if one user has deleted singleton object while…

Read the full article