Serverless (P2P) chat application for local network

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
liagason
Posts: 1
Joined: Mon Feb 01, 2016 7:27 pm

Serverless (P2P) chat application for local network

Post by liagason » Mon Feb 01, 2016 7:40 pm

Hello everyone,

I would like to build a very simple chat messenger to use to exchange messages with computers connected to my home network (LAN).
I don't want to run a server on any of them, but instead, i'd like to broadcast the message to the full range of IPs of my router and if another client is running, receive it.

Is that possible with LC?
Last edited by liagason on Sun Apr 29, 2018 5:36 pm, edited 1 time in total.

A1Qicks
Posts: 79
Joined: Sat Dec 26, 2015 10:47 am

Re: Serverless (P2P) chat application for local network

Post by A1Qicks » Tue Feb 02, 2016 5:04 pm

I'm by no means an expert on LiveCode or messaging, but I've been playing around with chat systems for a couple of weeks now.

Assuming you're not going to have colossal numbers of clients on the network I can maybe see a way to fudge it.

If you treat every client as also being a server, and have each one pass on every message to the next one... I don't have time to explore it but it may be an avenue to explore if no one more knowledgeable than me suggests anything!

A1Qicks
Posts: 79
Joined: Sat Dec 26, 2015 10:47 am

Re: Serverless (P2P) chat application for local network

Post by A1Qicks » Fri Feb 12, 2016 2:05 pm

http://lessons.livecode.com/m/4071/l/12 ... ng-sockets

To expand on this, if you look at the code for a server, all it does is accept connections on a certain port.

If you have each client do this, and then any time a client connects, it looks for another client, the two could connect and either can work as the server.

Then when a third connects, it looks for the first one that works as the server, and connects to it. The server sends it the list of connected users. Then if the server disconnects, one of the other clients picks up the role.

Post Reply