problems with sockets on panther
Dar Scott
dsc at swcp.com
Tue Jul 20 02:23:36 EDT 2004
I usually use "after" instead of "before" so I can get a chronological
log.
I added some lines to check for errors. Maybe that will help.
On Jul 19, 2004, at 8:25 PM, Björnke von Gierke wrote:
> "server" button:
> on mouseUp
> accept connections on port 80 with message "webConnect"
put "Accept result:" && quote & the result & quote & return before
field "log"
> put "Accepting" & return before field "log"
> end mouseUp
>
> on webConnect RemoteIP
> put "socket:" && the opensockets & return before field "log"
> put RemoteIP & return before field "log"
> read from socket remoteIP until ":"
put "Read result:" && quote & the result & quote & return before
field "log"
> put it & return before field "log"
close socket RemoteIP -- It should be OK to simply let the other
end close, though.
> end WebConnect
>
>
>
> "client" button :
>
> on mouseUp
> open socket to "192.168.1.2:80"
put "Open result:" && quote & the result & quote & return before
field "log"
> put theSocket & return & mess
> write mess to Socket theSocket
put "Write result:" && quote & the result & quote & return before
field "log"
-- mess and theSocket are not defined
close socket theSocket -- If not here, then at the other end.
> end mouseUp
If webConnect is really called, then you should see the opensockets.
It should include the accept port, the client end and the server end.
You don't show the closing. You might have errors because you are
already open.
Try the loopback IP address: 127.0.0.1
Dar Scott
More information about the use-livecode
mailing list