Socket and tsnet
Posted: Tue Feb 18, 2020 4:40 pm
I´m using tsnet to connect to an API with results from rallying (motorsports). At the same time i have asked my program to open a socket waiting for information when the cars passes the goal line.
TSNET
The tsnet connections delivers information in JSON that is transfoRmed to an Array with 50 or so lines. The tsnet-connection is over the internet.
SOCKET
I use port 1100 for the socket command. The message is coming in locally from another software on the same machine (localhost:1100).
The socket connection delivers a string of 15-20 characters.
MY PROBLEM
The tsnet-processes stops the information coming in over the open socket.
How can I work around this? Can I use tsnet to oisten on a port. Or have I missed something?
Jakob Rubenson
CODE: SOCKET
on mouseUp pMouseButton
accept connections on port 11000 with message "clientConnected"
read from socket pSocket with message "messageReceived"
end mouseUp
on clientConnected pSocket
read from socket pSocket with message "messageReceived"
end clientConnected
on messageReceived pSocket, pMsg
put pMsg into theTime
read from socket pSocket with message "messageReceived"
end messageReceived
TSNET
The tsnet connections delivers information in JSON that is transfoRmed to an Array with 50 or so lines. The tsnet-connection is over the internet.
SOCKET
I use port 1100 for the socket command. The message is coming in locally from another software on the same machine (localhost:1100).
The socket connection delivers a string of 15-20 characters.
MY PROBLEM
The tsnet-processes stops the information coming in over the open socket.
How can I work around this? Can I use tsnet to oisten on a port. Or have I missed something?
Jakob Rubenson
CODE: SOCKET
on mouseUp pMouseButton
accept connections on port 11000 with message "clientConnected"
read from socket pSocket with message "messageReceived"
end mouseUp
on clientConnected pSocket
read from socket pSocket with message "messageReceived"
end clientConnected
on messageReceived pSocket, pMsg
put pMsg into theTime
read from socket pSocket with message "messageReceived"
end messageReceived