PDA

View Full Version : Article: Using LuaSockets


Brett
08-26-2005, 04:00 PM
See the attached document for full details.

From http://www.cs.princeton.edu/~diego/professional/luasocket/

"LuaSocket is a Lua extension library that is composed by two parts: a C core that provides support for the TCP and UDP transport layers, and a set of Lua modules that add support for functionality commonly needed by applications that deal with the Internet."

In other words, the LuaSocket library allows you to do both low-level and high-level TCP and UDP communication from AutoPlay Media Studio 6.0 projects.

TJ_Tigger
08-26-2005, 04:04 PM
:eek: ... :eek: ... :eek:

Dermot
08-26-2005, 04:51 PM
Wow! that's great! :yes

Thanks Brett, that' sure to come in handy.

Intrigued
08-26-2005, 05:08 PM
Brett. . . what happen to the bar? (as in, "raising the bar"). We are way beyound that!

Thanks for sharing! It might be another day in the code matrix for you... but it's a code maze for the rest of us (if I may be so bold).

:yes

Worm
08-26-2005, 05:58 PM
Too cool! Simply too cool!

Eagle
08-26-2005, 06:58 PM
Ditto * 4 ... :)

TJ_Tigger
08-26-2005, 08:59 PM
Does this mean that there will be inter-app socket communications?

Intrigued
08-26-2005, 09:50 PM
Brett, I noticed this in your documentation(again, thanks for sharing), FWIW:

package.cpath=_SourceFolder.."\\AutoPlay\\Scripts\\?.dll;"

It looks like the semi-colon needs to be at the end?

Dermot
08-27-2005, 01:05 AM
Brett, I noticed this in your documentation(again, thanks for sharing), FWIW:

package.cpath=_SourceFolder.."\\AutoPlay\\Scripts\\?.dll;"

It looks like the semi-colon needs to be at the end?

I copied and pasted Brett's code and it worked fine. Seems to work either way.

Intrigued
08-27-2005, 01:06 AM
Ya, just looking for clarification. (hence the question mark at the end).

:yes

Brett
08-27-2005, 09:55 AM
Actually the internal semi-colon is by design. That path allows for multiple search locations separated by semi-colons (even though I only specified one so it will work either way).

Brett
08-27-2005, 09:57 AM
Does this mean that there will be inter-app socket communications?

As far as I can tell that should be possible. The LuaSocket library allows you to open sockets and send/recieve on them.

<Jack Bauer>Chloe, open up a socket! There's no time Chloe, I need that socket open NOW!</Jack Bauer>

Intrigued
08-27-2005, 10:16 AM
Actually the internal semi-colon is by design. That path allows for multiple search locations separated by semi-colons (even though I only specified one so it will work either way).

Ah, I gotcha. I thought I had seen you post something like this before and I was wondering....

johnperry9
10-04-2005, 12:38 AM
Hi Guys,

Thank you guys for all of your great help. I am trying so hard to write two programs that will communicate with each other. The server where you can click on a button and it will put text in a text box on the client, also it would play a simple wav. This is a sort of "notification" software, where the server can send a preset message to the client over a network. If anyone knows how to use luasocket, or has any ideas, please please let me know. Thanks again.

bule
02-01-2006, 02:41 PM
<Jack Bauer>Chloe, open up a socket! There's no time Chloe, I need that socket open NOW!</Jack Bauer>

You almost killed me with this one...

kildin
04-17-2006, 06:47 AM
See the attached document for full details.

Is this download still available - you say "Then go to the Download page and download the “PC Win32 binaries”. Can't find “PC Win32 binaries” with the content you describe in your .pdf :huh

nrgyzer
04-18-2006, 01:38 AM
Yes, I'am too. I downloaded the file, but I only have two folders (lib and lua). The folder lib are only contains two folders with a core.dll. But the lua folder contains the folder socket (contains the following files: ftp.lua, http.lua, smtp.lua, tp.lua, url.lua) and the files ltn12.lua, mime.lua, socket.lua. But where is the lua.exe, compat-5.1.lua, liblua.dll and other files? I can't find this files in my downloaded package.

Worm
05-11-2006, 09:44 AM
Download the Simple Web Server (http://www.indigorose.com/forums/showthread.php?t=13268) or Simple Chat Server (http://www.indigorose.com/forums/showthread.php?t=13246) here on the forums. They have all of the necessary Lua Socket files included.

johnperry9
06-28-2006, 10:52 PM
Hey guys, ok, I have been working on this off and on for almost a year now, as you can tell from my earlier post, and I still have yet to figure this out. Is there ANYONE out there that can help me with this??? Thanks. I guess I am not a natural coder, lol.

Tek
06-29-2006, 12:10 PM
Yeah I'm stuck in the same boat. I know the vast majority of users here don't use LuaSocket but I have been trying to learn it anyways. :) Unfortunately, time is always my worst enemy.

DjArko85
08-05-2006, 07:55 PM
Hi Worm,

Thank you for your example... :)

This example are for a LAN, how can i do it for INTERNET?
I reyed your webserver example, but it work only with my brother's computer...
My friend can't see that...

Thank you...



Download the Simple Web Server (http://www.indigorose.com/forums/showthread.php?t=13268) or Simple Chat Server (http://www.indigorose.com/forums/showthread.php?t=13246) here on the forums. They have all of the necessary Lua Socket files included.