yyl
2026-03-04 bc1cb6da854cb2e9144f10ed55330a537ecdca16
Main/Core/NetworkPackage/Socket/ClientSocket.cs
@@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;
#if !UNITY_WEBGL && !H5_VERSION
#if !UNITY_WEBGL
using System.Net;
using System.Net.Sockets;
using System.Threading;
@@ -20,7 +20,7 @@
{
    GameNetEncode encoder = new GameNetEncode();
    
#if !UNITY_WEBGL && !H5_VERSION
#if !UNITY_WEBGL
    // TCP Socket 实现(非WebGL平台)
    Socket m_Socket;
    public Socket socket { get { return m_Socket; } }
@@ -43,7 +43,7 @@
    { 
        get 
        {
#if !UNITY_WEBGL && !H5_VERSION
#if !UNITY_WEBGL
            return m_Socket == null ? false : m_Socket.Connected;
#else
            return webSocket != null && webSocket.State == WebSocketState.Open;
@@ -66,7 +66,7 @@
        this.socketType = type;
    }
#if !UNITY_WEBGL && !H5_VERSION
#if !UNITY_WEBGL
    // ==================== TCP Socket 实现 ====================
    public void Connect(string _ip, int _port, Action<bool> _onConnected)
@@ -623,9 +623,9 @@
    // WebGL需要在Update中轮询消息
    public void DispatchMessageQueue()
    {
// #if !UNITY_EDITOR
#if UNITY_EDITOR
        webSocket?.DispatchMessageQueue();
// #endif
#endif
    }
    
#endif