AsyncStreams Client question...

Gary Miyakawa

Active Member
Licensed User
Longtime User
Ok, I've got my little world (basically, a Telnet like client) working with straight sockets but I'm reading and it would appear that AsyncStreams would be a much better way to do what I need to do.

I've read/reread/rereread the AsyncStreams tutorial and generally understand BUT I'm struggling :BangHead: with the concept of me (the client) opening something that will "listen" when I don't know what port I should be listening to... Since I'm initiating contact (just like a Telnet client) I don't know (and don't see anything that tells me) what port, the client should be listening on to get the responses..

Sorry for the newbie type question but I just haven't found my answer out th ere..

BTW, B4A is SUCH an advancement for developing code on Android... I sure hope you guys make Millions !! (I made my contribution)...

Thanks folks !

Gary Miyakawa
 

flyingbag

Member
Licensed User
Longtime User
AsyncStreams doesn't deal with the actual connection.
You should make the connection like you currently do and then initialize AsyncStreams by passing the input/output streams to AsyncStreams.Initialize.
Ok, I as a newbie still have the same problem as Gary. The AsyncStreams tutorial is great - but i cannot get my head around the connections bit

Basically i want an app on android device 1 to talk to the same app on android device 2... and send some text to / fro

If i understand correctly - i need to use sockets to do the connections between server and client as mentioned here http://www.b4x.com/forum/basic4android-getting-started-tutorials/7001-android-network-tutorial.html

And Then - use Asyncstreams to do whatever i need to?
Or am i missing something?

Is there a simple example project available somewhere that I can look at?

Thank you
 
Upvote 0
Top