Yes, I've disabled my firewall and also added this port as allowed on both sides. I've even tried placing my router and my own PC in the DMZ.
Main Topics
Browse All TopicsHello, I am kind of new to java programming. I recently wrote a small chat program that works with wired connections from PC to PC. But when I tried it using a wireless connection I believe my router(linksys) would not allow me to do so, even if I was connected to with a wire to the router the same problem. Is there any specific code in Java to eliminate this problem?
Here's what I have to do the connections:
ServerSocket ssock;
Socket client;
//server side
ssock = new ServerSocket(sock_num);
client = ssock.accept();
//client side
client = new Socket(IP,sock_num);
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> I've even tried placing my router and my own PC in the DMZ.
Make sure that your server side is in the DMZ but if both of your comptures are part of the linksys network then there isn't need for
that. Can you provide the stackTrace from your exceptions? Do you run the server before the client (so it will bind and wait before
any clients connection?)
I run the server before the client, but the connection resets when I try to send to the server an object stream. Yes, I can telnet and ping from one PC to another. Another error I get is null, but I haven't tried using the printStackTrace exception which I will try out now. Thanks aozarov. The only thing is I don't really know what you mean by if the server will bind and wait before any clients connection, could you show me a piece of code that does this?
see this: http://java.sun.com/docs/b
You want to make sure that the server created the ServerSocket before the client created its Socket
othewise you will loose that call. If you are using Object streams it is advicable to create first the ObjectOutputStream and then
the ObjectInputStream.
>> For a connection to reset it must first have been made musn't it?
Well, I think (and I can see that you don't) that the asker confuse terms and uses "reset" for the case where new Socket(....) failed (or maybe that
he is not aware that this is the point of failure). Adding the stackTrace as I suggested can clear this out pretty easy.
>And please refrain from making personal remarks.
Where exactly personal remarks?
I thought it was you that once suggested reading http://www.experts-exchang
Where exactly do you feel I have violated the rules? Please accept my apology if I have made your experience unpleasant, it was never my intention. I will say though that sometimes your comments can come across as being a little aggressive, which may have been a misinterpretation and I apologise if so. Thats one of the problems of this form of low bandwidth communication.
Can't speak for CEHJ but I can say he does his best to try and make my life difficult on EE as well :(
As for points, they are worth nothing and in no way drive my participation here, I'm here to help peple solve there problems. Unfortunately there are some who are driven by points at this site (typically ones that are the ones always complaining about points distribution) but theres not much we can do about that.
Hello everyone, this time I tried to connect from a public wireless network to a DSL. I had the server side running on the PC with DSL and I ran the client side from the public wireless network. Still no connection...
Here's the output from the printStackTrace:
Error: Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream
at java.io.ObjectInputStream$
at java.io.ObjectInputStream$
at java.io.ObjectInputStream$
at java.io.ObjectInputStream.
at java.io.ObjectInputStream.
at SecureChat.<init>(SecureCh
at SecureChat.main(SecureChat
Line 257: ObjectInputStream ois = new ObjectInputStream(client.g
Line 394: is in a catch statement, the last line of code in main
Once again, I am trying to establish a connection, from wireless to wireless, or wired to wireless with/without linksys router. It works for 2 PCs that are connected to their corresponding ISPs directly through their modem. Is there any code in java that can bypass this?
Well, it is possible. There is the gateway IP address and then the actual IP address of the host. I try connecting to the host. This is where I think I'm wrong because it is a DSL connection and other computers in the vicinity, that have DSL by the same provider, have the same IP address. I have to somehow connect through the gateway and then have it route to my target IP address.
Yes, this was my question in the first place. Since the router sends me back an error message(disconnects/resets
Business Accounts
Answer for Membership
by: objectsPosted on 2005-05-11 at 17:28:56ID: 13983111
What errors are you getting, may be a firewall blocking that port.
If check your firewall configuration and use an open port.