I am using socket programming to connect two PCs in java through wi-fi. I used the ip address of the server at the client side. but the problem is that when the ip address of the server got changed then i have to change the ip address of server at client side. and when i use host name for connection nothing happens. is there any way to use static ip or any other solutions that can work to connect both of them which can work on any network. independent of ip address of the server.
please suggest me the solution.
I am using socket programming to connect two PCs in java through wi-fi. I
Share
i think there is a simple solution to your problem …
you should get the ip address of your device by using Inetaddress.getbyName(“user-pc”).getHostAddress()
hope it will work for u…