How can I send variables over the internet on QBasic? - qbasic

I'm making a little multiplayer retro game in QBASIC (QB64). I need to send some integers from one player to the other. Does anyone know how I can do it and who can maybe give me the source code?

Exchanging data via tcp/ip with QB64: http://www.qb64.org/wiki/Inter-Program_Data_Sharing_Demo

Another link to swap tcp/ip data:
http://www.qb64.org/wiki/OPENHOST
might work.

Related

How to do a ONLINE „Buzzer“ in Unity

Ok so I want to have a pressable Button. And whenever someone presses it (on their computer in another network) I want my game to react to it.
It should work like this website:
https://buzzin.live/
People should be able to log in with a username and press a button. I tried searching how to do smt like this but I haven‘t found an answer.
Networking is a really weird topic with very few tutorials (and most of the tutorials are about online fps‘) so I hope to get help here :)
I see two options
Unity's client server networking seems a bit intense for a simple event implementation.
What I would do if I were you is look into WebSocket servers (more than pure tcp servers since usually websocket libraries are easier to use than pure tcp)
Either that or you could look into Unity messaging API which doesn't require to support the whole multiplayer shebang, just simple message passing. I would do some research into Unity's Network Messages and look around.
https://docs.unity3d.com/Manual/UNetMessages.html
Setting up a simple client-server project is pretty straight forward and Unity manages the connection for you.

Sockets used to send messages between machines

I want to make a sort of chat server between my desktop and my laptop using sockets. Does anybody know of a good tutorial on this or if you have any files with comments on it that I can use as reference?
This could be good at the beginning of your adventure:
https://medium.com/swlh/lets-write-a-chat-app-in-python-f6783a9ac170

Connecting/Tunneling through a proxy so you appear to be connecting from another country(iOS)?

I'm interested in trying to make a connection from within my app to a proxy somewhere in the UK so I can listen to radio streams there that are blocked from the UK.
What would it take technically to implement this?
Is this even possible with the API available within iOS?
Many Thanks,
-Code
I think you need to use a VPN for this kind of thing. I have (of course) never done this myself but you could use OpenVPN in theory. I don't know how useful this is and there is a writeup here to explain why I say this. You need to jailbreak your phone.

what type of network programming is necessary in iPhone online multiplayer game?

I am asking this question as a small part of my question series regarding game programming .
Refer this question as the main one .
Now suppose I want to develop a game on iphone - a simple online multiplayer board game.
Suppose its a casino table.
In the main question ChrisF has tell me of sort of Client - Server architecture for iphone online multiplayer game.
I want to know what sort network programming I have to do for this type of application .
What will be the responsibilities and activities carried out by client and server .
You can provide me link, tutorials or to the point answers , anything will be great help for me and will be really appreciable .
thanks
You'll want to write a socket application running on a server. When you have access to a wifi access point or edge/3g you can send data to it from your iphone application. This server can then handle the incoming data and send an appropriate reply to the people connected.
For server socket programming, take a look at this guide - http://beej.us/guide/bgnet/.
For iphone specific socket programming, take a look at the samples supplied with the Iphone SDK. This link also has some basic information.
A simple online multiplayer board game
Given that the iPhone isn't always connected to the internet, you might need a server to store state. Alternatively you could always stipulate that if one person loses their connection the game finishes.
Client to client would be the obvious choice for the latter. Both clients have a port they listen to, and send the other commands based on the board state. Like almost all online games the obvious choice would be to use UDP as it's fast and compact.
For the server architecture you will of course need some kind of server listening for commands and a game number. It would store your state in a datastore on the server, a mySQL database for example. UDP or even SOAP or JSON over HTTP would be the two obvious choices for this.
This second approach using JSON/SOAP route would be a lot easier for you to get started with, assuming the iPhone has a decent JSON or SOAP library which is not likely. I have no idea about UDP in Objective C, however in C it requires a certain level of knowledge which won't get you something to play with quickly.
As you already said, you will need a server, but you can have two kinds of design:
The server can serve only as a gateway between the players to connect one to each other: it's two uses are, first, to list the running games, and second, to list the IP addresses of the players so that each client will read the IP addresses and connect to them. This will require less bandwidth and processing power for the web server and more for the client which will host the game. In this configuration, one of the clients will act as a server and will send data to the others. If your game has only one of the players playing at a time, and not a huge lot a players, this is what you should use as what you pay is the server's power.
The server can also store all games' states: it might require far more processing power and/or bandwidth depending on your game.
Anyway, most of the time you will want only one machine (which can change during the game as in the first case) to do the processing and the others will only receive the computed data.
To program a networked game, you will need knowledge of sockets (deep knowledge in the first case because you will have to deal with NAT issues, routers blocking the way between clients). The guide to that is Beej's Guide to Network Programming, the number one ressource on this topic, although it doesn't focus on games.
If not too much processing is needed on the WWW server, you could deal with it with server scripting languages like PHP along with MySQL, but you're most likely to use your own server programmed in C++ (or in C). If you use C++, you might want to use an already existing library such as RakNet.
The client will obviously be programmed in Objective-C as it's on the iPhone. I believe there is a good networking framework looking at the number of online games, so you might as well not want to use an external server networking library.
It might be a bit too much for what you want to do, but you could also use the well known Torque Engine.

iPhone socket program

I want to create an extremely simple iPhone program that will open a telnet session on a lan-connected device and send a sequence of keystrokes. Most of the code I've seen for sockets is overwhelming and vast overkill for what I want to do:
open telnet socket to IP address
send ascii keystrokes
Any simple code examples out there I can play with?
I'd suggest you check out the Asyncsocket project:
It makes socket programming really easy; no messing with threads yourself and things happen asynchronously without much fuss.
I think there is a sample project with a client/server to get you started.
Do yourself a favor: go read at least first 6 chapters of this Steven's book in which you can find plenty of simple examples and many advices how to avoid common pitfalls with network programming. Without doing that you will end with a buggy, slow and incomplete client.
Go through this you will have to get basic idea of socket programming
http://ichuiphonedev.blogspot.in/2012/07/a-basic-idea-of-socket-programming-in.html
i cant repost my code here, because SO considers it spamming to repeat your answer.
check out this sample code and tutorial link. works like a charm and is really simple to implement, less than 3 minutes and you are up and going (IF you have a socket server ready).