Hi Thomas,
It's important to realize that all TCP/IP comms is asynchronous. And I strongly recommend using the Async open as well.
This means you need a "Window" procedure, because you need Events.
You can of course hide the window ( window{prop:hide} = 1) if you don't want the user to see it.
Once the port is Open, you are free to send as much as you like inside a loop. You cannot however do error handling after a Send. (because things are happening asynchronously). If there is an error then the ErrorTrap method is called.
However if you need to wait for an Ack before sending the next bit then sending in a loop is not for you. In that case you need to send, and then do nothing. When the ack arrives the .Process method is called. You can check the ack, and send the next packet (and so on.)
The good news is that once you've got the basic structure sorted out, the rest should be pretty easy. Incoming packets can be handled in .Process, Errors can be handled in ErrorTrap.
The NetDemo example is a good place to start. This lets you open a server, and a client, window so you can play around in plain text.
Cheers
Bruce