tsNetCustom and HTTP/0.9 error

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
webmaster
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 83
Joined: Mon May 09, 2011 3:01 pm

tsNetCustom and HTTP/0.9 error

Post by webmaster » Mon Oct 13, 2025 10:58 pm

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!!

isabellspivey
Posts: 3
Joined: Mon Aug 18, 2025 3:20 am

Re: tsNetCustom and HTTP/0 .9 error

Post by isabellspivey » Mon Mar 02, 2026 4:50 am

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.

Post Reply