SocketTimeOutException on iPhone thrown immediately

53 views
Skip to first unread message

Eyal Muchtar

unread,
Nov 5, 2013, 12:41:12 PM11/5/13
to codenameone...@googlegroups.com
Hi,
In my application i'm using PHP server. When running the following code on iPhoned devices i get almost immediately SocketTimeOutException

Dialog dlg = UiUtils.showDialog("Loading", "Data / Image Processing...", true);
        connRequest.setDisposeOnCompletion(dlg);
networkManager.addToQueueAndWait(connRequest);
resBytes = connRequest.getResponseData();
System.out.println("resBytes= " + new String(resBytes));
return resBytes;

It occurs constantly on iPhone devices and less on Android devices. It never occurs on emulator.

How it can be solved?

Shai Almog

unread,
Nov 5, 2013, 2:44:36 PM11/5/13
to codenameone...@googlegroups.com
Hi,
did you invoke set timeout on the network manager or connection request at any point in time?

Eyal Muchtar

unread,
Nov 6, 2013, 1:17:46 PM11/6/13
to codenameone-discussions
I'm using the following code:
connRequest = new MultipartRequest();
connRequest.setUrl(holder.getRequest());
connRequest.setPost(true);
connRequest.setTimeout(1000);



On Tue, Nov 5, 2013 at 9:44 PM, Shai Almog <shai....@gmail.com> wrote:
Hi,
did you invoke set timeout on the network manager or connection request at any point in time?

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/UgWKNRW0JVI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/719a4255-d8db-43b8-9fa8-8f1f2c13571d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Sincerely,

Eyal Muchtar
EM-PROJECTS
+972-52-2405134
ey...@em-projects.com
Skype: eyalm_nm

Shai Almog

unread,
Nov 6, 2013, 1:35:51 PM11/6/13
to codenameone...@googlegroups.com
1000 millisecond timeout == 1 second timeout

Eyal Muchtar

unread,
Nov 6, 2013, 1:45:21 PM11/6/13
to codenameone-discussions
Should I remove the 
          connRequest.setTimeout(1000);
command  or should i change it to bigger value?



On Wed, Nov 6, 2013 at 8:35 PM, Shai Almog <shai....@gmail.com> wrote:
1000 millisecond timeout == 1 second timeout

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/UgWKNRW0JVI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/groups/opt_out.

Shai Almog

unread,
Nov 7, 2013, 12:47:15 AM11/7/13
to codenameone...@googlegroups.com
Either one will work just fine.

Eyal Muchtar

unread,
Nov 7, 2013, 4:41:40 AM11/7/13
to codenameone-discussions
Ok.
I did so and it working grate.


On Thu, Nov 7, 2013 at 7:47 AM, Shai Almog <shai....@gmail.com> wrote:
Either one will work just fine.

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/UgWKNRW0JVI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages