Peer to Peer Networking Stack

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Peer to Peer Networking Stack

Post by splash21 » Tue Mar 11, 2014 9:21 am

splash21 wrote:I downloaded Corona and Gideros yesterday (both Lua based) and had a quick read over the Lua socket library. It took a very small amount of code to get two devices connected via p2p (Scotland => England).
splash21 wrote:Here's a simple example (that works)...
BvG wrote:You said that this is possible for other languages, which sounds like you've used it or seen it in a documentation somewhere?
Correct.


In Lua;

Code: Select all

setsockName("*", 10300)
Binds the UDP socket to local port 10300. Then when you connect to a remote peer, information originates from port 10300 on your machine. The cool thing is that if it's added to LiveCode, you can also write the server app with LiveCode - same language for all components.
LiveCode Development & Training : http://splash21.com

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: Peer to Peer Networking Stack

Post by DarScott » Thu May 01, 2014 8:44 pm

I like the idea of being able to specify the sender's port in sending datagrams. I probably have an ancient enhancement request related to this in the bug database.

Recently, I have seen hints that this other enhancement request is available, but I'm not sure if it works or even if it was there all along:

If you accept a datagram, you can reply back on the same port you are listening on. Receiving a datagram effectively opens a socket that can be used to send a datagram back. That sent datagram will be from the port you are listening on.

Also, you can criss-cross datagram communication, both sides receive on some specified port and send from some random port.

I'm not familiar with methods for getting through firewalls with datagrams other than setting up the filters, so I'm not sure if this helps.

Post Reply

Return to “Internet”