Home > Back-end >  /socket is not in a local area net two computers to communicate?
/socket is not in a local area net two computers to communicate?

Time:09-21

Two computers, a server, a client, if all connection home router, can use socket communication,
Now a computer connection mobile hotspot (China mobile), another computer connected to the home router (broadband), could you tell me the IP address on how to set up to communicate? Or other tools needed?

CodePudding user response:

If your mobile hotspot is a public IP, to just go, otherwise can't do that, with some agent software, you can put your home computer set to public IP, you can access the phone

CodePudding user response:

need one IP networks outside.. At the other end connect outside network IP port can communicate,

CodePudding user response:

Both in different network network, can't direct communication,
Or looking for operators to broadband public IP address (IP network to also go after the network address translation),
Either I would have to find a forward among the public server as a server, refer to the principle of TeamViewer,

CodePudding user response:

In a word, need a public IP,
1. Direct, don't use your home broadband routing, cat, even the computer directly to the computer as a server,
2. Agents mode, 3/f said the TeamViewer that needs an agent, public forwarding request, A server, agent for the client even A, at the same time to do the service side by B company, forwarding A, B's request, indirect implementation even A, B
3. The port mapping, routing, you can set the port mapping (port forwarding), home computers to do the server (port 9111), another client, even the routing (port 9222), routing port 9222, forwarded to the home computer port 9111, indirect implementation. A, B connection problem (actually the principle and way of agent 2)
4. Make hole technology (details Suggestions to baidu TCP make hole), probably is, need to create A temporary public first server C, A, B, make the client even C, C do A client IP, port told A, B, and AB disconnect and C, C can also close the service, A with C tell AB do server IP and port to bind, client B do even A IP and port, followed by AB direct, no C, [recommended home computer as A terminal, don't know what the reason, the service side of mobile phone when hot, make hole not success, of course you can try]

Are there any other way, but no matter what way, there must be a public IP,
  • Related