Author Topic: I need help creating a program to send strings from PC to PC over internet  (Read 4652 times)

0 Members and 1 Guest are viewing this topic.

Offline Kazman

  • Newbie
  • Posts: 14
    • View Profile
Hi to all :)

I searched all over the forum, but I can't find a program that works correctly :(

I would like to make an online game, but I am unable to find a way to send/receive a simple string from my PC to another one not in my LAN, but in other one (or even other building, city, etc).

I found some chat programs in the forum, and I tried my public IP in the server, but the client (running on another PC) does not find it. I don't know if this happens because of my net configuration, or the program is wrong.

In order to make my online game working, I only need to send strings from one PC to another; both programs (client and server) would read these strings and could communicate each other... but as I said before, I can't find a decent working program :(

Can you help me? Thank you very much!!!

PS: Sorry for my terrible english, I'm from Spain.

Kazman

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
You should start by looking into these pages on the wiki.

https://qb64.org/wiki/OPENCONNECTION
https://qb64.org/wiki/Downloading_Files

there is more to it than that, needing ports open and stuff. But it can be done. Just not as simple as connect to such and such a computer and send. You need to have things setup first on both ends.
Granted after becoming radioactive I only have a half-life!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
You definitely will need to have ports open on your router to allow traffic from the outside to your PC. Same for the other side's PC. Once you get over that hurdle, you'd communicate with both PCs by the public IP of your router. The router will forward the communication to the device that you have selected for that port to be forwarded to. It's pretty simple
Shuwatch!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
@SpriggsySpriggs Rob put together a routine, over a decade ago, to send emails with QB64. It worked on his end, I could receive his emails, but failed on my end. It turned out my internet provider was not allowing my message to be sent. I'm only bringing this up in case it is another hurdle in TCP/IP communications between two computers. It may not be the same as our email situation, but just in case. Thoughts?

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
@Pete I think it's a different issue.
Shuwatch!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
I'd say it's a firewall or router/port forwarding issue. 
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
@SpriggsySpriggs Rob put together a routine, over a decade ago, to send emails with QB64. It worked on his end, I could receive his emails, but failed on my end. It turned out my internet provider was not allowing my message to be sent. I'm only bringing this up in case it is another hurdle in TCP/IP communications between two computers. It may not be the same as our email situation, but just in case. Thoughts?

Pete
For the record, some internet service providers treat port 25 (the port used for sending email in a naive setup) specially. The idea is that by blocking it they can stop people from sending spam.

This is likely unrelated to op's question though, which is probably a matter of setting their router to do port forwarding. Note that it's also possible their internet service provider is using carrier-grade NAT which makes such a setup impossible without contacting them, but this is relatively unlikely.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
@luke Rob did mention the part about some isp's creating a block to prevent sending spam emails. It's been too long for me to remember any discussion about port 25. I still remember back in the day a book on TCP/IP programming weighed more than one of Steve's prize winning turnips, and I should know. It's not the first turnip truck I've fallen off.

Anyway, I hope the OP gets the message this is no small task and there may not be a one-size-fits-all solution.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
For the record, some internet service providers treat port 25 (the port used for sending email in a naive setup) specially. The idea is that by blocking it they can stop people from sending spam.

This is likely unrelated to op's question though, which is probably a matter of setting their router to do port forwarding. Note that it's also possible their internet service provider is using carrier-grade NAT which makes such a setup impossible without contacting them, but this is relatively unlikely.

@luke  It's not as impossible as you'd think.  My ISP port forwards all DYNAMIC IP addresses from their modem to your router, but port blocks all STATIC IP addresses, where you have to call them and have them open and bridge a port for communication.  It's why I could fire up my chat server and run  it with no issues on my laptop, but not my PC. 

My PC is hardwired into the network, and has a static ip which I use as a part time web/game server.  My laptop is portable and runs off wifi, so it's just set to dynamically acquire a free ip address.  The PC requires bridge port opening; the laptop doesn't.  My ISP packages it like that as "Static IPs are generally reserved by businesses and companies, and we block unnecessary ports to help protect them from any system vulnerabilities."

Which makes it all this stuff much more dang complicated that it really needs to be!
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Has the OP considered a really, really long Ethernet cable? I mean don't laugh, that whole Transatlantic cable thing eventually came together. Now if you will excuse me, my tin can phone is ringing.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Kazman

  • Newbie
  • Posts: 14
    • View Profile
Re: I need help creating a program to send strings from PC to PC over internet
« Reply #10 on: October 22, 2021, 07:24:08 am »
Thank you for your answers. I will keep my investigation :)

PD: By the way, I will think about buying a really, really long ethernet cable :P

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: I need help creating a program to send strings from PC to PC over internet
« Reply #11 on: October 22, 2021, 11:45:22 am »
Thank you for your answers. I will keep my investigation :)

PD: By the way, I will think about buying a really, really long ethernet cable :P

It's a shame Radio Shack isn't still around. I hear they had tons of those in stock, just before they went out of business. Go figure?

Pete 🤣
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/