?
Solved

2 network interface tcp server

Posted on 2013-01-22
6
Medium Priority
?
536 Views
Last Modified: 2013-01-28
I am trying to make labview program to replace a java program on a pc(192.168.1.88). The PC has 2 network interfaces with different subnet.
 
The first step is the program will start a tcp server, then a client(192.168.1.44) will connect in. The java program works fine, but my labview program all the time waiting and no connection in.
 
I tried when both program run, the port 5001 will be open, and the client package will be arrive.
 
But only the java program will response
 
Any suggestion, thank.
0
Comment
Question by:turbot_yu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 5

Assisted Solution

by:Harsem
Harsem earned 2000 total points
ID: 38804595
Hello,

you state your server has got 2 interfaces, and from the sound of things you start the program yet you cannot conenct to it from 192.168.1.44 to 192.168.1.88.

One thing to test would be to see on which IP address the server is waiting. I do not know what Operating System your PC is running, in Windows you can type:

netstat -nab

For linux you can type:

netstat --tcp --listening --programs

which will show you what applications are waiting on what ports & IP addresses. I would appreciate if you could shuw us that output.

Another thing you can check is to make sure your Firewall (Windows Firewall or Linux iptables) allows incoming connections on the port your application is using (TCP 5001).

Can your PC with the 2 interfaces connect to itself on port 5001? I would just want to make sure that this works first.

One more thing, I would always try to use telnet to test if the Server (your PC with 2 network interfaces) is accepting incoming connections on the port. So I would go on to the 192.168.1.44 and telnet to 192.168.1.88 on port 5001:

Windows (from a cmd prompt)/Linux (same command):
telnet 192.168.1.88 5001

If successful the screen will just blank out. If it is not successful then you will see it time-out and then state that the connection was unsuccessful.

Please let me know how you go with the above.

Jens
0
 

Author Comment

by:turbot_yu
ID: 38805102
It is win7, the netstat record is as attached for port 5001. Or the whole result is needed. The avast firewall is off.

I write a small test client program run locally, can connect to labview and java both.

I tried tera term can also connect to labview and java both.

I also check the routing table, there is one for 0.0.0.0   0.0.0.0   172.16.5.1

Any suggestion, thanks.
ss.png
0
 
LVL 5

Assisted Solution

by:Harsem
Harsem earned 2000 total points
ID: 38805124
Hello,

for directly connected networks no route is required - so I doubt it is that.

From the print-screen it looks like Java was bound to all available IP Addresses, while Labview is bound to a single IP address.

I am not familiar with Labview - is there a way to bind it to all available IP Addresses?

Jens
0
Four New Appliances. Same Industry-leading Speeds.

But don't take it from us.  The Firebox M370 is Miercom tested and Miercom approved, outperforming its competitors for stateless and stateful traffic throughput scenarios.  Learn more about the M370, M470, M570 and M670 and find the right solution for your organization today!

 

Author Comment

by:turbot_yu
ID: 38805726
Labview has a setting to choose network interface for tcp server, but I already set it.
0
 

Accepted Solution

by:
turbot_yu earned 0 total points
ID: 38808323
The routing table is attached, is there any thing not correct, thanks.
0
 

Author Closing Comment

by:turbot_yu
ID: 38826097
thk
0

Featured Post

Ransomware Attacks Keeping You Up at Night?

Will your organization be ransomware's next victim?  The good news is that these attacks are predicable and therefore preventable. Learn more about how you can  stop a ransomware attacks before encryption takes place with our Ransomware Prevention Kit!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question