Client Socket cannot connect to running Socket server

后端 未结 3 2043
醉话见心
醉话见心 2021-01-22 17:18

I have Android client app that communicates with server using Socket.

On my development machine, SocketServer (server is also written in Java) i

3条回答
  •  佛祖请我去吃肉
    2021-01-22 17:57

    If I got it right: your socket server is running on a separate machine. You cannot use 127.0.0.1 to connect to that server through your Android phone as that is the local loop back address. Find your machine's IP address and use that instead.

    In case of using it on the emulator when you try to connect to the socket server running on your machine you still cannot use 127.0.0.1 as that is local loop back address for the Emulator.

提交回复
热议问题