LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Loopback without using 127.0.0.1 (https://www.linuxquestions.org/questions/linux-software-2/loopback-without-using-127-0-0-1-a-4175587273/)

YehudaSinger 08-17-2016 10:20 AM

Loopback without using 127.0.0.1
 
Dear sir/Mrs.
I want to create a client-server application on Red-Hat.
For the server, the socket creation and bind work fine. For the client. I have problems if I wand to connect to the client socket with the server socket using the connect function. Suppose that the server IP address is 192.168.1.9. If I get the server information using the getaddrinfo, and use that information for the connect step' the connect function falls. If I use the IP 127.0.0.1 the connect works.
Is there a FIRWALL that prevents me?
Yehuda

jefro 08-17-2016 09:59 PM

Could be firewall.

The problem with local host is that it sometimes acts odd so don't fully trust any test with it.

Bubushi 08-18-2016 03:18 AM

Quote:

Originally Posted by jefro (Post 5592374)
The problem with local host is that it sometimes acts odd so don't fully trust any test with it.

Any particular reason jefro why loopback acts more oddly than any other interface?

I would say it is a problem with the firewall since you can connect through loopback interface. Anyways to be sure you can easily check it with netstat on the server or telnet from the client to the particular tcp port to the server. Or even wireshark to check whether the packets are arriving to the server.

Since you are writing the code yourself you can use exceptions to debug it.


All times are GMT -5. The time now is 11:23 AM.