• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Socket not connected when using host ip address.

 
Greenhorn
Posts: 14
  • 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
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the host name

 
sharin shazizi
Greenhorn
Posts: 14
  • 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: 194
  • 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()?
 
Rancher
Posts: 2265
20
Android Java ME Eclipse IDE Java
  • 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
  • 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
  • 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: 194
  • 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
  • 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...
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic