Andre's post: Rev and the Web...

Alex Tweedly alex at tweedly.net
Fri Dec 26 19:07:08 EST 2008


Brian Yennie wrote:
> Randall,
>
> Read the docs on sockets. It's actually not that much harder that what 
> you describe below, but you're going to have to at least try it =). 
> Once you have a few handlers working, you can have your own higher 
> level API.
>
> put "127.0.0.1:8080" into myServer
> open socket to myServer
> write myClientMessage to myServer
>
> and...
>
> accept connections on port 8080 with message "clientConnection"
>
> on clientConnection tSocket
>   read from tSocket until empty with message "myClientMessage"
> end clientConnection
>
> on myClientMessage tData
>    bla bla bla
> end myClientMessage
>
It really is pretty simple, but there are some tricky parts.   Take this 
code snippet, read the docs on send, accept, read from socket, write to 
socket, etc. and it will work ...

It might be better / easier (especially if you have two machines 
locally) to start with my simple examples from

    RevOnline / alextweedly / TCP App 1(and 2)
and also
   RevOnline / alextweedly / UDP echo client (and server)

Or leap straight in with the chat server / client from Bjoernke's site 
http://bjoernke.com/runrev/chatrev.php 


> If you really want a game server, you're gonna have to work at the 
> socket level. The above IS "high level" socket programming. As you've 
> mentioned, you don't want to just fetch URLs which is the point at 
> which xTalk really abstracts away the details.
>
Yep.
>> Thanks Bill.  I hope you are going to provide this functionality 
>> wrapped into xTalk's easy message passing protocol...
>>
The message passing scheme doesn't extend to multi-player (or 
multi-receiver), so we need a different metaphor to handle that (as well 
as a different approach to handle asynchronous events from multiple 
other places).

-- Alex.




More information about the use-livecode mailing list