LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2015, 09:26 PM   #1
DrVonBraun
LQ Newbie
 
Registered: Jul 2013
Posts: 9

Rep: Reputation: Disabled
Unhappy What could be blocking incoming connections to my program?


Hi all,
I am brand new to Linux, playing around a bit with different things to see how I can use it in the future. Here is my problem:

I have written a simple program in Ada that works well on windows. It opens a TCP port (20000) and listens for incoming connections. I tried it on my internal network and it works well. I can connect from other windows machines and even from my Linux machine.

Now I moved the program to Linux and compiled it there. It starts ok and then listens for the connections. I can connect to it from that same Linux machine but not from any other machine on my network.

I checked the firewall status on Linux with ufw status and it is disabled. I also tried to add a rule to the iptables with
iptables -A INPUT -p tcp --dport 20000 -j ACCEPT

but still nothing. I can not connect from another machine on my network. I also tried to open a simple telnet connection from a windows machine and that too is blocked. I thought without the firewall all incoming connections would be allowed but obviously something is not working as I thought.

Any help would be greatly appreciated
 
Old 02-01-2015, 11:00 PM   #2
DrVonBraun
LQ Newbie
 
Registered: Jul 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Well I found the solution myself and post it here in the case that somebody else needs an answer to the same problem.
It appears that the Addresses function in Gnat.Socket returns addresses in different order on windows and on Linux and my code grabbed the address that represents the localhost on Linux but the correct IPV4 address on Windows and therefore it was working on Windows, but on Linux it was now listening only on the loopback device.
So, never rely on the order in which addresses are returned by the socket library
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
UFW blocking certain incoming requests and not sure why smells_of_elderberries Linux - Security 10 04-02-2013 06:19 PM
[SOLVED] non blocking socket doing other tasks while waiting for connections in C program lakshmun Programming 2 11-01-2010 04:41 PM
non blocking socket doing other tasks while waiting for connections in C program lakshmun Linux - Networking 1 10-27-2010 04:56 AM
Blocking incoming trafic on port 80 NeoNecro Linux - Networking 2 11-19-2007 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration