Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I send data between two computers over the internet
    primarykey
    data
    text
    <p>I have been struggling with this for the entire day now, I hope somebody can help me with this.</p> <p>My problem is fairly simple: I wish to transfer data (mostly simple commands) from one PC to another over the internet. </p> <p>I have been able to achieve this using sockets in Java when both computers are connected to my home router. I then connected both computers to the internet using two different mobile phones and attempted to transmit the data again. I used the mobile phones as this provides a direct route to the internet and if I use my router I have to set up port forwarding, at least, that is how I understand it.</p> <p>I think the problem lies in the method that I set up the client socket. I used: </p> <pre><code>Socket kkSocket = new Socket(ipAddress, 3333); </code></pre> <p>where ipAddress is the IP address of the computer running the server. I got the IP address by right-clicking on the connection, status, support. Is that the correct IP address to use or where can I obtain the address of the server? Also, is it possible to get a fixed name for my computer that I can use instead of entering the IP address, as this changes every time I connect to the internet using my mobile phone?</p> <p>Alternatively, are there better methods to solving my problem such as using http, and if so, where can I find more information about this?</p> <p><strong>EDIT:</strong> Would it be possible to have the server program running on a server on the internet somewhere. My original server would then be a client that send information to this server. This server would then pass this information to my original client and vice versa. That way, the IP address of my computer won't matter, as I only need to know the address of the server hosted somewhere on the web. Does this seem like a better solution? Where do I begin implementing such a solution? </p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload