B4J Question How do I create an asynchronous stream to receive data from an device

davepamn

Active Member
Licensed User
Longtime User
I need to port my B4A asychronous stream code to the b4j window socket with an asychronous stream handler for receiving data on a specific ip address. How do I create a second window socket connection and handle the incoming data stream?

B4A code:

Dim ast AsAsyncStreamsText

If ast.IsInitialized Then ast.Close

ast.Initialize(Me, "ast", serial1.InputStream, serial1.OutputStream) 'Needed! initialize AsyncStreamsText with the socket streams.



Sub ast_NewText(Text As String)

txtData.text=Text

End Sub
 

davepamn

Active Member
Licensed User
Longtime User
Yes
Will you provided a link to the winsocket tutorial, I should follow? I used asychrononous streams not win socket for b4a
 
Upvote 0

davepamn

Active Member
Licensed User
Longtime User
Correct
I use the asychrononous streams with a serial communication object in b4a

I need to explore the winsocket callback functions for b4j
 
Upvote 0

davepamn

Active Member
Licensed User
Longtime User
How does win socket and serial communication work together? Are they two separate ways to talking with the device?
 
Last edited:
Upvote 0
Top