Threaded TCP connection

BlitzMax Forums/BlitzMax Beginners Area/Threaded TCP connection

I've been messing around with TCP a couple days now.
Does anyone know how to achieve real threading, in such a way that your game does not hang when it for instance does a writeline/sendline?

Currently I have readline/writeline in my mainloop (through a server and a connection class, connection.update()), and with writeline, it will lock up completely, so I've resorted to using readbyte only when there's data on the socket. Then it doesn't lock up, but it's still not real threading, and I can't figure out how to do it just now.. Can anyone help? Basically I want to be able to fire off a couple lines to a stream, without worrying about a slowdown in my game.

(Yes I know of tnet/bnet/whatever mod, but I'm trying to learn the basics here, and I know UDP should be used for games, but the purpose here is sending data :))