BrandonPotter / SimpleTCP

Straightforward .NET library to handle the repetitive tasks of spinning up and working with TCP sockets (client and server).
Apache License 2.0
363 stars 108 forks source link

Namespace not available in Unity. #44

Open Almightygir opened 6 years ago

Almightygir commented 6 years ago

Hi,

I've compiled to DLL and imported into Unity, but the SimpleTCP namespace isn't available so i can't access any of the SimpleTCP library.

Is there something special i need to do to make this work with Unity?

Almightygir commented 6 years ago

Oh, it seems it's because it's targeting .net 4.5, and Unity Editor only supports 3.5, which breaks a lot of functionality.

Almightygir commented 6 years ago

Okay so... using the source code directly in Unity (with the editor scripting runtime version set to .NET 4.x equivalent) allows me to use the library, however compiling to to DLL and importing it still doesn't work.

I'm also having trouble setting my server to run a function on DataReceived, i would have thought this functionality would be somewhat standard?

harleyknd1 commented 6 years ago

Unity has its own network handler, see: https://docs.unity3d.com/Manual/UNet.html and https://docs.unity3d.com/Manual/UnityWebRequest.html

using this library for something that's already build into unity seems a bit useless