Punit Jain wrote:i have a client and server program, i mean client is communicating to the server, but my server is my same system, (localhost)..
but i want to ping other system instead of localhost, to do this i need to change the localhost to that system ip-address but that system is not connected to my system(neither wired nor wireless). but that system has access to internet??
how can i connect or ping to that system..??
192.168.1.5 is the client system IP Address
i found this by simply firing the command ipconfig in command prompt.
both the system are connected to the same router.
and i m running both the programs on the server(i mean on my computer), same time in two command prompts.
When you do new Socket(address, port), that address has to be reachable from your client computer
Punit Jain wrote:
When you do new Socket(address, port), that address has to be reachable from your client computer
but the address is of my client computer.
do i need to run my client.java on client computer??
or both (Server.java and Client.java) on server computer.
So that's the IP address of both the client and the server?
And you're starting the server first?
ping localhost
ping 192.168.1.5
telnet localhost 1001
telnet 192.168.1.5 1001
Punit Jain wrote:
So that's the IP address of both the client and the server?
not this is only client's ip address my is 192.168.1.3.
192.168.1.5 is the client system IP Address
this [JV: "this" being IP 1.5] is only client's ip address
my [JV: "my" is the server?] is 192.168.1.3.
telnet localhost 1001
telnet 192.168.1.5 1001
both saying: could not open the connection to the host on port 23, connection failed.
Punit Jain wrote:works for me...
thank you very much...
one more thing i just want to know..
in this case both of the system are connected to same router..
but i want to do this, with some other machine which is not connected to this router, only connected to internet..
that time also will it work??
one more think also if other machine is not connected to internet, that time also is it possible???
Thank you...
Punit Jain wrote:also i want to know, we have 4 machines connected to same router.
i want to create a application using which we can chat to each other.
how can i do this?
i mean do i need to give ip address of all the machines??
Punit Jain wrote:okay...
one more thing, i tried to connect one system with broadband and disconnect from router..
Punit Jain wrote:i mean, earlier client and server both the machines are connected to the same router.
but now i disconnected client machine to that router and and directly connected client machine to other broadband.
now it's not working.
Again, none of this has anything to do with Java. Your java code will never know or care anything about these details of which host is behind which router, and you won't change your Java code based on the configuration.
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|