Nowhere in your initial post do you mention nor show that the AStream_NewData sub that is located in you Main module is called from your astreams_NewData sub located in your class. From your initial post, I don't see nor are you showing us (via logs/pop ups, etc.) that astreams_NewData is actually called. Just from that little bit that you are posting, one would gather that you opened an AsyncStream in Main and initialized it with "AStream" as the prefix for the callback subs and you created another AsyncStream in you class that has "astreams" configured as the prefix for you callback subs. Nowhere though do you show us where / how you are initializing your AsyncStreams, so I'm even guessing that you named you prefixes such without accidentally misspelling them.
What is not easy to test? You can always use log() to log anything and everything, especially if you are not sure if a certain code path even gets executed/called.
Hi Oliver,
You are right, I have not explained the situation well. I am connecting to SDR Radio hardware using TCP which has a fast data rate up to 1Myte per second.
I have started with a Erel TCP example. I can connect to the hardware, and I get data coming through that I can decode using...
data via Sub AStream_NewData
Termination via Sub astreams_Terminated
Errors via Sub astreams_Error
I tried to modify
Private Sub astreams_Error
astreams.Close
CallSubDelayed(mTarget, mEventName & "_Error")
End Sub
to
Private Sub astreams_Error
astreams.Close
CallSubDelayed2(mTarget, mEventName & "_Error",LastException.Message)
End Sub
For some reason that did not work, so I then tried just catching the error in a string
That's when I noticed I could pass a string from "Class Module" to "main" using my own sub in the class module
But not with
Sub AStream_NewData
Sub astreams_Terminated
Sub astreams_Error
that were in the same module
The reason I am using a sub rather than Logs is I want my code to take action based on what the error's are.
Again I apologise for not explaining in detail from the outset, and I really appreciate your help.