Hi Victor - my file download code needs something similar, and I
noticed the SocketImpl interface in the java.net module has a listen
method, which sounds ideal - having trouble finding a socket that
implements it, though. Hope this helps.


On Jul 14, 6:57 am, Victor Lin <[email protected]> wrote:
> Hi,
>
> I am developing a program that needs async socket. I am new to Android
> and Java. As I can see in the document, to write network program, I
> got Socket and SocketChannel, but it seems they are all sync socket,
> it means, I need an extra thread to call blocking read, write... and
> etc. Here comes the problem, my program is a chat room, the
> communicate is not linear, I have no idea when the server will send a
> message to me, if I read in that thread to wait message from server,
> but the user want to send message to server, the reading function
> blocked forever, if there is no incoming data, then the pending
> outgoing message will not be sent. That's why I need async socket. So
> my question is: How to write async socket under Android environment?
>
> Thanks.
> Victor Lin.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to