Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't connect to server via socket

 
Adam Krupczynski
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to create client/server application. I wrote both, compile (client is an applet) and run on my localhost and everything worked fine. Unfortunately, when I uploaded my client and server applications on server I can't connect and get IOException here:


where "host" is a string; it contains external IP of my server.

I tried to sign applet but nothing changed. Is it possible that Ubuntu on that server somehow block socket connection? Maybe I have to add something in java.policy file? I've searched on google and this forum, read a lot of threads but I couldn't find solution. What can be wrong with it?

E: Ok, I dig a little deeper and now I'm getting "Network is unreachable: connect". but still I can't find out how to fix it...
 
Carey Evans
Ranch Hand
Posts: 225
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it was an applet security problem, like with java.policy, I'd expect you to get an AccessControlException. It could be a firewall problem on the server or the client; you could use nmap to see what ports get through, or try opening the connection from a Java application instead of an applet.
 
Adam Krupczynski
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
thanks for answer. Nmap said after scan that port which I'm using to connect is filtered. Currently I'm trying to open any port, because standard

iptables -A INPUT -p tcp --dport _myport_ -j ACCEPT

doesn't work. So it seems that it's not a java problem anymore, but if anyone knows simple way to fix it it would be great .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic