build hints to improve IOS sockets data reading

9 views
Skip to first unread message

shop.servic...@gmail.com

unread,
Feb 5, 2019, 7:34:30 PM2/5/19
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 Pro
Simulator latest
Device IOS, iPhone 8+, Ipad II IOS 12.1.1

Generally speaking when My Server sends Images larger than ~ iMB, IOS times out and I get 
java.net.SocketException: Connection reset by peer: socket write error on The Server

I am using:

public static int MPI_BUFFER_SIZE = 65536;
public static int socketTimeOut = 30000;
Socket mySocket = new ca.weblite.codename1.net.Socket(host, port, socketTimeOut);
mySocket.setReceiveBufferSize(MPI_BUFFER_SIZE);

I am old school and have been working with sockets for 30 years and wonder if you have any suggested reasonable synchrounous client/server comms that work well in the mobile world.

BTW. The current Socket implementation works well for me with this exception on IOS.

Thoughts?

Shai Almog

unread,
Feb 5, 2019, 10:26:56 PM2/5/19
to CodenameOne Discussions
I would generally avoid sockets for mobile as they are inherently less reliable. If anything I'd use websockets instead of sockets.

If I understand correctly you are using this https://github.com/shannah/CN1Sockets
In that case you can just edit the code and submit a pull request if there are features missing.
Reply all
Reply to author
Forward
0 new messages