0

I'm programming a fat client in Java that permits sending files. So from LAN 1 with public IP (so called pip1), a first fat client (fc1) with local IP (lip1) sends a file to a second fat client (fc2) on LAN 2 (pip2) via WAN. I use the protocol TCP/IP on port 8081. So it is working only if I port-forward the port 8081 for lip1 on LAN1's router and with the port 8081 for lip2 on LAN2's router...

It is awful: I guess you have understood I'm not good with network stuff. :s What is your suggestion? I use java.net.ServerSocket

  • 1
    A client can't send data to another client. Somewhere there has to be a server. If that server is behind a NAT device, there has to be port forwarding. This is not a programming problem but a network setup problem. – user207421 Sep 02 '20 at 11:49
  • Yes, I name my application a fat client because it is installed on each user's environment. But inside it, there is a true client part who uses a socket to send data, and a server part, launched in another thread waiting for incoming data with a ServerSocket. –  Sep 02 '20 at 13:15
  • Indeed, when you install a software on your computer, it cannot wait for data from outside? –  Sep 02 '20 at 13:18

1 Answers1

0

Hmm, I guess I didn't research enough on the topic. :s I have found many ideas here: