Page 1 of 1

tsNetCustom and HTTP/0.9 error

Posted: Mon Oct 13, 2025 10:58 pm
by webmaster
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!!

Re: tsNetCustom and HTTP/0 .9 error

Posted: Mon Mar 02, 2026 4:50 am
by isabellspivey
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:

Code: Select all

put tsNetOpen(tHost, tPort, "socketCallback") into tSocket
tsNetWrite tSocket, tCommand & cr & cr
Callback:

Code: Select all

command socketCallback pSocket, pEvent, pData
   if pEvent is "data" then
      put pData into field "log"
   end if
end socketCallback
Your device is plain TCP, not HTTP — so don’t use HTTP-mode commands.