File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket not connected when using host ip address.

 
sharin shazizi
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im using socket on applet. Both client and server using applet. The program works within localhost. But when i tried using different computer in LAN, the socket is not connecting.




the host ip address is 192.168.1.3
client ip add is 192.168.1.2
please help...thank you
 
Ryan Beckett
Ranch Hand
Posts: 192
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the host name

 
sharin shazizi
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried using the hostname...still doesnt work...is there any other way?
 
Ryan Beckett
Ranch Hand
Posts: 192
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See )]InetAddress.getByAddress(byte[] addr) if you want to use an IP address.

Is the server running before you try to connect using the client? Did you try testing the socket connection in the client using Socket.isConnected()?
 
Swastik Dey
Rancher
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you able to ping server from your client pc? If yest try to telnet the server from your client on the specified port and make sure its not blocked by any firewall and is running properly.


c:\>telnet <server_ip_addr> <port_num_on_which_the_server_is_running>

 
sharin shazizi
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried to telnet and i am able to telnet. the thing is, before this i used basic socket without applet and it can communicate. but when i use the applet, it doesnt work. the applet only works within localhost environment. if i reside client and server on different machine, then it cant connect at all...i don understand why...

Is the server running before you try to connect using the client? Did you try testing the socket connection in the client using Socket.isConnected()?


yup, the server is running before connecting the server.
 
sharin shazizi
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you think its realted t Signed Applet? if it is, what should i do?
 
Ryan Beckett
Ranch Hand
Posts: 192
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, I totally forget about that. Yeah, applets run in a sandbox (a secure browser environment that restricts an applet privileges). And, one thing I know is not allowed is communication with a server that didn't issue the applet.
 
sharin shazizi
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying all..i guess im gona hv to keep on trying within less than 5 hours before my system evaluation. cz i seriously dont know how to deal with signed applet. it looks complicated... i don even understand it...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic