"accept" and socket read/write

Richard Gaskin ambassador at fourthworld.com
Thu Feb 12 12:16:30 EST 2015


Dr. Hawkins wrote:

 > I did some testing a couple of years ago launching standalones and
 > confirming that that the could indeed do things in preOpenStack before
 > attempting to open  the main card (and crashing as a result, due to
 > the lack of an Xserver . . .)

You can bypass the xorg init by launching the standalone with -ui:

    ./standalone -ui

While still single-threaded in a technical sense, socket I/O appears to 
have something almost like green threads when used with callbacks ("with 
message"), e.g.

command broadcastServerStart
     accept connections on port kPort \
            with message "broadcastServerClientConnected"
end broadcastServerStart

While not a true thread, this appears to allow non-blocking behavior so 
network I/O appears be handled separately for different connections, 
though until I do more testing I can't say for sure exactly how 
independent that is.

But the modest test I did some time ago on my cheap 1GB VPS had a LC 
standalone acting as a socket server able to handle a surprisingly large 
number of requests with little CPU time and RAM:

<http://lists.runrev.com/pipermail/use-livecode/2015-January/210576.html>

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list