Replying over a socket

Dar Scott dsc at swcp.com
Mon May 9 13:33:43 EDT 2005


On May 9, 2005, at 11:07 AM, Scott Slaugh wrote:

> write "message received" to socket theSocket
...
> read from socket "1.1.1.1:8080 <http://1.1.1.1:8080>" for one line

The first line does not write a line ending and the second expects it.

> open socket to "1.1.1.1:8080 <http://1.1.1.1:8080>"

Address 1.1.1.1 is a reserved public (Internet) address.  Are you using 
this as a private address?  That should work, but there might be 
problems.  Maybe for initial testing you can use "127.0.0.1:8080"

I assume you have nothing else that might be listening on 8080.  Check 
'the result' for everything.  You might try some other port.

Handle the socketClosed, socketError and the timeout messages and put 
status displaying stuff there.

> Additionally, I would like the client handler to pause until the 
> response is
> received, since it is acting as a request command.

If you would like to do stuff while that is waiting, then use 'with 
<message>'.

Dar

-- 
**********************************************
     DSC (Dar Scott Consulting & Dar's Lab)
     http://www.swcp.com/dsc/
     A sponsor of RevCon West '05
**********************************************



More information about the use-livecode mailing list