Solved

2 network interface tcp server

Posted on 2013-01-22
6
512 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
  • 4
  • 2
6 Comments
 
LVL 5

Assisted Solution

by:Harsem
Harsem earned 500 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 500 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops 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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now