sacOO7 / SocketclusterClientDotNet

C# client for socketcluster framework in node.js
http://socketcluster.io/#!/
Apache License 2.0
69 stars 16 forks source link

[Request] A C# client for unity game engine. #1

Closed nguyenhaian closed 7 years ago

nguyenhaian commented 7 years ago

When I import this lib into Unity game engine, there are errors.

Assets/socketcluster/ScClient/Proxy/HttpConnectProxy.cs(75,35): error CS1061: Type System.Net.EndPoint' does not contain a definition forConnectAsync' and no extension method ConnectAsync' of typeSystem.Net.EndPoint' could be found. Are you missing an assembly reference?

Assets/socketcluster/ScClient/Proxy/HttpConnectProxy.cs(145,39): error CS1061: Type byte[]' does not contain a definition forSearchMark' and no extension method SearchMark' of typebyte[]' could be found. Are you missing an assembly reference?

Assets/socketcluster/ScClient/Socket.cs(74,29): error CS0121: The call is ambiguous between the following methods or properties: System.Linq.LINQ.FirstOrDefault<ScClient.Socket.Channel>(this System.Collections.Generic.IEnumerable<ScClient.Socket.Channel>, System.Predicate<ScClient.Socket.Channel>)' andSystem.Linq.Enumerable.FirstOrDefault(this System.Collections.Generic.IEnumerable, System.Func<ScClient.Socket.Channel,bool>)'

Can anyone help me? Thank you.

sacOO7 commented 7 years ago

Hey, for now try to comment out code that shows error. Don't use HttpConnectProxy in project for now. Comment out two methods in Socket.cs: 1] public Channel getChannelByName(string name) 2] public void setProxy(string host, int port) { var proxy = new HttpConnectProxy(new IPEndPoint(IPAddress.Parse(host), port)); _socket.Proxy = (SuperSocket.ClientEngine.IProxyConnector)proxy; }

If there are just 3 errors you have listed above this might fix it. If it is working we can replace above methods with another code.

nguyenhaian commented 7 years ago

@sacOO7 thank you. I can now connect to server.