W wl Well-Known Member Licensed User Longtime User Aug 11, 2014 #1 Hi, I'm not entirey sure I understand how the AsyncStreams work internally. I'm making a Server which can server multiple clients (such as in: http://www.b4x.com/android/forum/threads/asyncstreams-tutorial.7669/#content): will EVERY connecting client create two threads: one for reading and one for writing ? Or: will there only be ONE reading and ONE writing thread for all clients ? I understand that in _NewData for example I can call RaiseEventFromDifferentThread to have code being executed on the main thread ? If I use RaiseEvent in for example _NewData: the code will be executed in the reading thread created for the given client ? Thanks !
Hi, I'm not entirey sure I understand how the AsyncStreams work internally. I'm making a Server which can server multiple clients (such as in: http://www.b4x.com/android/forum/threads/asyncstreams-tutorial.7669/#content): will EVERY connecting client create two threads: one for reading and one for writing ? Or: will there only be ONE reading and ONE writing thread for all clients ? I understand that in _NewData for example I can call RaiseEventFromDifferentThread to have code being executed on the main thread ? If I use RaiseEvent in for example _NewData: the code will be executed in the reading thread created for the given client ? Thanks !
Erel B4X founder Staff member Licensed User Longtime User Aug 12, 2014 #2 Each AsyncStreams object uses two threads. See this example (in the second post) for an AsyncStreams based server: B4J CCTV example You need to have a good reason to use such a solution instead of building a real server with jServer library... Upvote 0
Each AsyncStreams object uses two threads. See this example (in the second post) for an AsyncStreams based server: B4J CCTV example You need to have a good reason to use such a solution instead of building a real server with jServer library...
W wl Well-Known Member Licensed User Longtime User Aug 12, 2014 #3 Thanks Erel. I do: I'm going to build an SMTP server Upvote 0