Linux to WindowsXP TCP

D

Dan McLeran

I'm having alot of trouble getting a Java app on a WindowsXP box to
talk to a Java app on a RedHat Linux 9.0 box. It seems like it should
be trivial but it's not working. My RedHat Linux box has 3 NIC cards in
it, as does my WinXP box. I am attempting to hook 2 of the NIC cards
together with a cross-over ethernet cable and open up a Socket between
them. WinXP see the NIC card as being connected, but I cannot get the
Linux box to establish a Socket with the server. I've put a couple of
code snippets below just in case anyone sees anything obvious.

I have the server running on WinXP:

try {
ServerSocket serverSocket = new ServerSocket(6969, 0,
InetAddress.getByName("192.168.69.1"));

System.out.println("listening on ip address " +
serverSocket.getLocalSocketAddress().toString() + " port " +
serverSocket.getLocalPort());

Socket client = serverSocket.accept();

System.out.println("Connected: " +
client.getInetAddress().toString());
}
catch(final SocketException e) {
e.printStackTrace();
}
catch(final IOException e) {
e.printStackTrace();
}

And the client running on Linux under X windows:

try {
Socket socket = new Socket();

socket.bind(new
InetSocketAddress(InetAddress.getByName("192.168.101.1"), 6969));

System.out.println("bound to " + socket.getLocalSocketAddress());
System.out.println("bound = " + socket.isBound());

socket.connect(new
InetSocketAddress(InetAddress.getByName("192.168.69.1"), 6969), 1000);

System.out.println("Connected: " + socket.isConnected());

}
catch(final SocketException e) {
e.printStackTrace();
}
catch(final UnknownHostException e) {
e.printStackTrace();
}
catch(final IOException e) {
e.printStackTrace();
}
 
L

Luc The Perverse

Dan McLeran said:
I'm having alot of trouble getting a Java app on a WindowsXP box to
talk to a Java app on a RedHat Linux 9.0 box. It seems like it should
be trivial but it's not working. My RedHat Linux box has 3 NIC cards in
it, as does my WinXP box. I am attempting to hook 2 of the NIC cards
together with a cross-over ethernet cable and open up a Socket between
them. WinXP see the NIC card as being connected, but I cannot get the
Linux box to establish a Socket with the server. I've put a couple of
code snippets below just in case anyone sees anything obvious.

Did you open the TCP ports in the firewall?
 
I

im

Did you open the TCP ports in the firewall?

Can you ping the server from the client machine? Are there any other TCP based
servers (http, telnet, ftp, pop etc) running on the XP server that you can
connect to with telnet or a web browser, from the client machine?
 
D

Dan McLeran

Did you open the TCP ports in the firewall?

That's a good point. I'm not sure what state the ports are in. Does the
firewall apply to all NIC cards? One of my NIC cards on each machine is
used to access the outside world. The NIC cards within the confines of
this discussion do not. The idea is that they would be in a closed,
local network where everyone knows everyone else's ip address. But I'm
not sure if the firewall cares about that, probably not.

Thanks for the response.
 
D

Dan McLeran

I didn't try that yet. I was using some Java examples I found on the
web and thought it would work str8 away. I'll try to ping tomorrow and
see what I get.
 
N

Nigel Wade

Dan said:
I'm having alot of trouble getting a Java app on a WindowsXP box to
talk to a Java app on a RedHat Linux 9.0 box. It seems like it should
be trivial but it's not working. My RedHat Linux box has 3 NIC cards in
it, as does my WinXP box. I am attempting to hook 2 of the NIC cards
together with a cross-over ethernet cable and open up a Socket between
them. WinXP see the NIC card as being connected, but I cannot get the
Linux box to establish a Socket with the server. I've put a couple of
code snippets below just in case anyone sees anything obvious.

It would be interesting to see the IP assignments of the various network cards,
and the corresponding routing tables.

Can the two machines communicate in other ways?
 
D

Dan McLeran

It was the firewall. I turned it off completely and now the 2 computers
talk with no problems. Thanks for the response.
 
D

Dan McLeran

That was it! I turned off the firewall completely and it works. Now I'm
gonna go back and only enable what I need to enable to keep it working.

Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top