I would like to just connect up the socket to the other computer and then get a Delphi event every time data has been received.
In the "(Delphi DLL) Asynchronous Sockets - Reading/Writing Data" example it is just looping waiting for data.
I have not found that events are supported for the delphi dll. ( I am missing something)
So does this mean I have to spin up another thread to do the work of checking for in coming data or is there some simpler solution that I am missing.
If I do have to spin up a thread are there any examples?
I think there are two options:
1) In your application code, create a separate thread to receive on the socket synchronously, and when data arrives you can notify your main UI thread however you may desire.
2) Use the Async version of the Chilkat method to receive in a background thread, and then periodically check to see when the task is finished.
I would recommend #1. There are two things you'll need to figure out:
A) How to start a new thread and how to pass information to the function that is called on the started thread.
B) How to pass information from your background thread to the main UI thread (such as when data arrives on the socket).
Once you solve these 2 problems, you'll have these general recipe's in your arsenal for all future Delphi programming, and you'll likely find them useful to re-use over and over. That's why I would recommend #1.