Sockets (again)

Ralph DiMola rdimola at evergreeninfo.net
Mon Jun 29 17:58:10 EDT 2020


Bob,

I think you are doing the write too soon.
On the open socket command add "with message "MyConnectionAccepted"
Do the write in the MyConnectionAccepted handler.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net


-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Bob Sneidar via use-livecode
Sent: Monday, June 29, 2020 5:42 PM
To: How to use LiveCode
Cc: Bob Sneidar
Subject: Sockets (again)

Hi all. 

I’m trying to get sockets working. The host is working, but I am not getting the message to trigger. Here’s the basic code: 

on mouseUp
   put "test" into tPayLoad
   open socket to "localhost:8085"
   write tPayload to socket "localhost:8085"
end mouseUp

-- socket handlers
on acceptConnections
  accept connections on port 8085 with message "ConnectionMade"
end acceptConnections

on ConnectionMade pIPAddress
  read from socket pIPAddress with message "dataReceived"
end ConnectionMade

on dataReceived pSocket
put pSocket
   <snip>


ConnectionMade gets called, but dataReceived does not. 

Bob S

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list