[android-developers] Blocking on a Socket read operation

2010-01-29 Thread YuHao
Hi All:
   Android emulator is available as a socket server and socket
server as a service at background, when service start, I open a thread
to start listening, when use client to connect socket server and write
data to waiting for server response, this time the server is running
to the read() method then blocking , the client has already called
flush () method, Unless shutdown the client socket  in order to
service socket read and print the data, why?

Cheers,
YuHao

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


[android-developers] Blocking on a Socket read operation while in sleep mode

2009-12-28 Thread Omer Gilad
I have code that runs in the background and holds a connected Socket
and it's InputStream.
It calls read() infinitely until something is received, then continues
to parse. Socket timeout is 0 of course.

I am interested in what would happen when the device goes to sleep? Is
the CPU off? Will this socket be responsive in this case (Say, my
server sends some notification)?

Thanks

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