Blocking on a Socket read operation while in sleep mode

by Omer Gilad » Tue, 29 Dec 2009 06:11:02 GMT

Sponsored Links
 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)?



Blocking on a Socket read operation while in sleep mode

by Raj » Wed, 20 Jan 2010 02:06:36 GMT

 Yes, the CPU is OFF when the device goes to sleep. The socket is non-
responsive at this time.
Hope that helpps.

> Thanks

Sponsored Links

Other Threads

1. Why setting TextView.Ellipsize as Marquee cause its sibling view in linearlayout redraw

We are using TextView's Ellipsize function to scrolling text in it and
there many other controls in our window.
We noticed CPU would go up to 50% if text started scrolling. After
digging deeper, we found all controls in our layout kept drawing when
texts scrolling. We wonder why? And how to avoid all controls

Best Regards



2. listview is getting me mad plase help

Should setOnItemClickListener 
listener) be used instead? Also, should the activity implement 
AdapterView.OnItemClickListener and not View.OnClickListener?

hi i cant press any item on my listview nor in the emulator nor in a real phone. item layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="" android:id="@+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <CheckBox android:id="@+id/RuleEnable" android:text="" android:layout_width="wrap_content" android:layout_height="wrap_content" ></CheckBox> <TextView android:id="@+id/RuleName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:focusable="true" ></TextView> </LinearLayout> listview layout <ListView android:id="@+id/Listado" android:layout_width="fill_parent" android:layout_height="250px" android:isScrollContainer="true" android:drawSelectorOnTop="false" android:choiceMode="singleChoice"></ListView> some code public class GuiActivity extends Activity implements View.OnClickListener, OnItemClickListener{ .... //lista means list in spanish lista = (ListView)findViewById(; RuleList = new ArrayList<SMSRule>(); loadRuleList(); adapter=new SMSRuleAdaptor(this,RuleList); lista.setAdapter(adapter); lista.setOnItemClickListener(this); this method is never called public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long id) { enable.setText("id: "+id); } -- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your (")_(")signature to help him gain world domination. --

3. Using WifiManager to connect to a network

4. Unable to set Camera Picture Size on Samsung Galaxy

5. API that reads text

6. GUI/CUI FTP Client

7. Cant find the solution for this GLSurfaceView error