Asynchronous Sockets still have problem in 5.4.2p2 with IL2CPP!!!

I think my problem is related to [[iOS + il2cpp] the callback of socket’s BeginSend sometimes get called few seconds after calling BeginSend] and [Asynchronous Sockets still have problem in 4.6.3f1 with IL2CPP]
I’m using Unity 5.4.2p2 now, and I encountered this problem in PS4 + il2cpp mode.

All I can do is to implement the socket layer using Send/Reeive/Accept… instead of BeginSend/BeginReceive/BeginAccept…!!!But this will make other problem!!

please help me!!Thank you very much!

here is question description : http://answers.unity3d.com/answers/1265699/view.html

http://answers.unity3d.com/answers/1265699/view.html

Here we just upgrade our project to 5.4.2o2 to support x64 in PS4. yet we found the network is no longer working well (only) when deployed on PS4x64.

//initial bytesData
//…

_Socket.BeginSend(bytesData, 0, bytesData.Length, SocketFlags.None, new AsyncCallback(SocketSended), null);

The BeginSend just don’t response. Neither SocketSended is called nor the server recieved the data. I’ve read about official logs that Asynchronous Socket is supported by IL2CPP in the 4.6.3 release, and the Socket connection works just fine(Socket.BeginConnect).

Can anyone help me out of that?

Update 3.17 : Just Locate the problem more sepecific. The none-functional code is like this below:

class tcpClient
{
public void Connect()
{
//init socket
//…

     mSocket.BeginConnect(..., OnConnected, ..);
 }

 public void SendData(...)
 {
     //init bytesData
     //...
     mSocket.BeginSend(bytesData,..., OnSended);
 }

 private void OnConnected()
 {
     mSocket.BeginReceive(..., OnReceived, ..);//when remove this line, SendData works
     
     SendData(...);
 }

 private void OnSended() { ... }
 
 private void OnReceived() { ... }

}
However, if I removed BeginReceive line, the BeginSend works again. Further more, I’ve tried to switch BeginSend to Send. It also doesn’t work. And Again, this situation only happened when my project is deployed on ios x64. In any other cases like ios x86/android/editor the code works just fine.

Update 3.18 :

I’ve created a simple client to test the .Net Asynchronous Socket interface. Turns out BeginSend and BeginReceive can work well separately. Only one can be functional when both used, the other must use the block method (eg. BeginSend + Receive/BeginReceive + Send)

use
Connect(IPAddress ipAddresses, int port);
instead
Connect(IPAddress address, int port);