Code Monkey home page Code Monkey logo

Comments (2)

wszhhx avatar wszhhx commented on June 20, 2024

做了几组对照试验:
1.用examples的Client连接skynet正常建立连接
2.本地客户端连接用Java搭建的服务端,正常建立socket连接
3.本地客户端连接skynet的example服务器,情况如本issue标题所示
4.用C#的System.Net.WebSocket库连接skynet的example服务器,情况如本issue标题所示
5.服务端调用socket.close_fd()时,客户端的socket状态会立即从connecting变成close

Ip地址与Port没问题
防火墙出站入战也没问题
抓包也正常发现了三次握手的包

然道是因为websocket不兼容?求大牛明示~
这是用UnityWebSocket库连接时,skynet的example服务器报的Log,内容与用skynet的client连接报的Log一样,看服务端这边的Log是无异常,区别就是客户端这里socket状态永远是Connecting。
1695457708370_B2DC238F-2744-4360-BE11-AA8207B9B98C

from skynet.

wszhhx avatar wszhhx commented on June 20, 2024

客户端调用UnityWebSocket代码:
public void Connect(string _ip, int _port)
{
if (m_socket != null)
{
if (m_socket.ReadyState == WebSocketState.Open
|| m_socket.ReadyState == WebSocketState.Connecting
|| m_socket.ReadyState == WebSocketState.Closing)
{
return;
}
}
m_socket = new WebSocket($"ws://{_ip}:{_port}");
m_socket.OnOpen += OnConnected;
m_socket.OnError += OnConnectFail;
m_socket.OnMessage += OnReceiveMessage;
m_socket.OnClose += OnClosed;
m_socket.ConnectAsync();
}

from skynet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.