Using sockets

Mark Schonewille m.schonewille at economy-x-talk.com
Tue Jan 14 12:42:18 EST 2014


Hi Pete,

Somehow, your server doesn't return data to client on the socket that 
the client expects.

The extra number might be a socket identifier. By using the socket, you 
can distinguish connections with different clients: 
127.0.0.1:10100|213213 and 127.0.0.1:10100|567657 are two different sockets.

If the client connects to a server and the new socket opened on the 
server side is 127.0.0.1:10100|567657 but you read from socket 
127.0.0.1:10100 with a callback message, a message will never be 
received on that socket and eventually the socketTimeout message will be 
triggered.

If this doesn´t solve it, can you post your script to show the problem?

If you want a complete example using sockets, you can read the telnet 
example on my blog at http://qery.us/43g and if you happen to have my 
book, you can also read about sockets there in chapter 18 ;-)

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other 
colour spaces. http://www.color-converter.com

Buy my new book "Programming LiveCode for the Real Beginner" 
http://qery.us/3fi

Fill out this survey please
http://livecodebeginner.economy-x-talk.com/survey/

On 1/14/2014 18:22, Peter Haworth wrote:
> Diving into yet another new are of Livecode for me - sockets.
>
> My server issues an accept statement for port 10100.  My client opens
> socket 10100.  WHen the client connects to the server, the port number I
> get is not 10100, but some other number which changes on each connection.
>   When sending messages between the client and server, which of these
> numbers should I use?
>
> My server uses read from socket with a callback message specified.  I have
> a socketTimeout message handler which fires every time the
> socketTimeoutInterval expires.  I thought the "read from socket with
> message" command was blocking and everything would stop until a message is
> received.  If that's the case, it seems odd that these timeouts should
> occur?
>
> Pete
> lcSQL Software <http://www.lcsql.com>





More information about the use-livecode mailing list