Class to detect if Server on port xxx is reachable w/o blocking for ever in IOS

13 views
Skip to first unread message

shop.servic...@gmail.com

unread,
Jul 16, 2017, 11:10:34 AM7/16/17
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA NetBeans 8.2
Desktop OS Windows 10
Simulator 3.7
Device IPhone 6 Plus

I have tested on Android and IOS
import ca.weblite.codename1.net.Socket;
try{
            ServerCommsKeepAliveSocket = new Socket(inc.host.getText(), inc.ServerCommsKeepAliveSocketPort, inc.socketTimeOut);
            ServerCommsKeepAliveSocket.close();
// Server is reachable
}catch(Exception e) {
   //  Server Is Not Reachable
}

Andorid works where as IOS causes a permenant lock.
The App is stuck and will not return from the "ServerCommsKeepAliveSocket = new Socket(inc.host.getText(), inc.ServerCommsKeepAliveSocketPort, inc.socketTimeOut);"

My Question is:
What is the best approach to testing if a Server / Socket is reachable w/o blocking forever in the case where the Server is down?

Shai Almog

unread,
Jul 17, 2017, 12:11:29 AM7/17/17
to CodenameOne Discussions, shop.servic...@gmail.com
If the socket is still open after the timeout that sounds like a bug in the cn1lib

shop.servic...@gmail.com

unread,
Jul 17, 2017, 8:14:54 AM7/17/17
to CodenameOne Discussions, shop.servic...@gmail.com
Thanks,

do I need to post this as a bug request or will you pass this along to the developers?


On Monday, July 17, 2017 at 12:11:29 AM UTC-4, Shai Almog wrote:

Steve Hannah

unread,
Jul 17, 2017, 11:10:36 AM7/17/17
to codenameone...@googlegroups.com, shop.servic...@gmail.com
Post it in the CN1Sockets issue tracker.  This is a known issue, I haven't had time to address.  Here is the existing issue for it.

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/0e0d7c68-5bb8-4618-bc7d-597501343d56%40googlegroups.com.

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



--
Steve Hannah
Software Developer
Codename One

Steve Hannah

unread,
Jul 17, 2017, 3:33:44 PM7/17/17
to codenameone...@googlegroups.com, shop.servic...@gmail.com
I have posted a fix for this.  Should be available in Codename One settings shortly.  Or download direct here

Steve

On Mon, Jul 17, 2017 at 8:10 AM, Steve Hannah <steve....@codenameone.com> wrote:
Post it in the CN1Sockets issue tracker.  This is a known issue, I haven't had time to address.  Here is the existing issue for it.

Steve
On Mon, Jul 17, 2017 at 5:14 AM, <shop.service.assistant@gmail.com> wrote:
Thanks,

do I need to post this as a bug request or will you pass this along to the developers?

On Monday, July 17, 2017 at 12:11:29 AM UTC-4, Shai Almog wrote:
If the socket is still open after the timeout that sounds like a bug in the cn1lib

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.
--
Steve Hannah
Software Developer
Codename One

shop.servic...@gmail.com

unread,
Jul 17, 2017, 9:10:41 PM7/17/17
to CodenameOne Discussions, shop.servic...@gmail.com
Thanks
Confirmed fixed in IOS,

Good Job! 


On Monday, July 17, 2017 at 3:33:44 PM UTC-4, Steve Hannah wrote:
I have posted a fix for this.  Should be available in Codename One settings shortly.  Or download direct here

Steve
On Mon, Jul 17, 2017 at 8:10 AM, Steve Hannah <steve....@codenameone.com> wrote:
Post it in the CN1Sockets issue tracker.  This is a known issue, I haven't had time to address.  Here is the existing issue for it.

Steve
On Mon, Jul 17, 2017 at 5:14 AM, <shop.servic...@gmail.com> wrote:
Thanks,

do I need to post this as a bug request or will you pass this along to the developers?

On Monday, July 17, 2017 at 12:11:29 AM UTC-4, Shai Almog wrote:
If the socket is still open after the timeout that sounds like a bug in the cn1lib

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
--
Steve Hannah
Software Developer
Codename One
Reply all
Reply to author
Forward
0 new messages