Peer to Peer "Chat"

Is it possible to create a simple peer to peer “chat” app using Xojo Desktop?
Preferably without having to program any web/php server functions?

Basically I would like to be able to have no more than 4 computers (macs and/or Windows) in various locations. Have each one send a text string and have the other 3 recieve it, act on it, and send something back. Not exactly a chat room, but same principle.

I don’t mind if each of the remote users even had to email an IP address to the others to start the process.

A number of friends and I usually get together to play various card games and such over the weekends, but a few of them are on the more paranoid side, and are self-isolating for a while. If I could pull off something tlike this, then we could still “play” just with some “social distancing” involved.

Sure, using UDP. There’s already an example Xojo app for this - UDPExample in Communications -> Internet.

Actually, after re-reading your request, looks like you’re talking about over the internet. At first I thought you meant being in the same building or on the same network.

I suppose you could make something similar by specifying individual addresses, but this means opening up ports (and probably port-forwarding) on each user’s internet router. Hence why everyone uses a public “server” somewhere to make this work easier.

I am trying to see if I can do something using CURL. Having it post “messages” to a server based file. But I’m having trouble figuring out a method that keeps everyone in synch, but minimizes the amount of data to be downloaded each time… Once a “message” has been processed it doesn’t need to be downloaded ever again

you basically described email but this time in a group fashion

and at some point the server might need to be able to trim that message list otherwise it grows infinitely long

but if each posted message has a UUID then each peer can grab the everything from the last message it got to the current ones and off you go

this is basically how POP/SMTP email works

Do you know:

http://docs.xojo.com/AutoDiscovery

?

which has nothing to do with peer to peer communicatons over a WAN… LAN yes, WAN no

A lot of routers even in a big corporate LAN would not route such discovery queries across segments
It can be very chatty to do so

It seems to me you need a “switchboard” app
Then when each client starts up and “logs in” they send in their IP
And then when a person wants to connect they ask the switchboard for that persons ip and the rest can then be direct client to client

Are you replying to AutoDiscovery ?

If so, isn’t the Internet a WAN ?

My implementation (not handy) was worldwide savy: I can connect to someone anywhere in the Internet. But that is all my memory have stored.

Read:
http://docs.xojo.com/UDPSocket.RouterHops

Especially that list:

Value Description
0 Same host
1 Same subnet
32 Same site
64 Same region
128 Same continent
255 Unrestricted

Nota: I used it as LAN, on WiFi Hot Spot between realWindows and macOS laptops, and that was working even if the Hot Spot is password / ID protected, never larger than that (not France / Europe / Earth group was found: no testers asked).

Skip the sentence:
The AutoDiscovery class lets you automatically discover other machines on the local network

An example is provided in the Examples folder, but I do not found where to set the RouterHops property.

BTW: if you use this, lower the sound (if you use it): I suspect it have crashed mines and the ones on the WIndows laptop.

A LOT of ISP and routers will NOT route UDP discovery requests across the internet
I worked in a company with an enormous LAN and they even closed UDP discovery across LAN segments
Its a thing