I'm building my first LiveCode app with tsNet networking. I have success sending commands to other devices using tsNetCustom (and the device responds to the request sent via TCP). But, the response coming back to the ResponseHandler has both an error code and I can't figure out how to process and display the returned data.
tsneterr: (1) Received HTTP/0.9 when not allowed
Server returned: [blank]
The device is supposed to send back to me "ACK" followed by a double-return when the command is received and processed successfully. But I can't figure out how to get that returned text so I can log success (instead of failure will return "NAK" along with a error description).
Do I need to send headers to force tsNet to operate in HTTP/1.1 mode? And how I can receive and view the returned data?
Thanks, guys!!
tsNetCustom and HTTP/0.9 error
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
isabellspivey
- Posts: 3
- Joined: Mon Aug 18, 2025 3:20 am
Re: tsNetCustom and HTTP/0 .9 error
Hello, you’re getting that error because tsNet is treating the connection as HTTP, but your device is returning raw TCP text (ACK + CRCR) — not an HTTP response. You do not need to send headers. Instead of tsNetCustom, use raw socket mode:
- tsNetOpen
- tsNetWrite
- Handle "data" in the callback
Example:
Callback:
Your device is plain TCP, not HTTP — so don’t use HTTP-mode commands.
- tsNetOpen
- tsNetWrite
- Handle "data" in the callback
Example:
Code: Select all
put tsNetOpen(tHost, tPort, "socketCallback") into tSocket
tsNetWrite tSocket, tCommand & cr & crCode: Select all
command socketCallback pSocket, pEvent, pData
if pEvent is "data" then
put pData into field "log"
end if
end socketCallback