alec1o / Netly

Cross-Platform and Multi-Protocol C# Socket Library. (Extremely fast and easy) 🇳 🇪 🇹 🇱 🇾
https://netly.docs.kezero.com
MIT License
58 stars 8 forks source link

Sockets problem on Android build #35

Closed alec1o closed 4 months ago

alec1o commented 4 months ago

After many test i find it.

Runnig on Android 11 (same error) Real Device Runnig on Android 9 (Android Emulator) MeMu Play Runnig on Android 9 (Android Emulator) BlueStacks 5


The origin of error is internal and unknow

It's definitely a DOTNET issue on android. Netly uses System.Net.Sockets as the basis for socket creation. This library is having internal errors in the Android device.

My suspicions:

  1. Android Manifest needs some kind of permissions.
  2. The compilation of System.Net.Sockets internally is not working due to some internal type of conversion (C# to C++/Java or object).

Doubts:

  1. The problem is with the TCP server or TcpClient. What about the server that is not working (listening directly?) or the TcpClient that cannot connect to the socket? (Needs to be tested)

  2. In case the problem is the TcpServer that cannot listen to the localhost on Android or the TcpClient that cannot connect to the localhost. How should you solve it if the problem is internal? (Do nothing?)

  3. How to move forward? Continue writing socket using System.Net.*? or start the base in C++ and the interface in C#?

Originally posted by @alec1o in https://github.com/alec1o/Netly/discussions/33#discussioncomment-8397518

alec1o commented 4 months ago

db1eda4de5b891b83578a676f11a9e0b197756ff

Backlog problem, (read more on commit description.)