From 90b83fbdcd395fb697c43f473bf1ef29d70ab519 Mon Sep 17 00:00:00 2001 From: "DESKTOP-B25GA9E\\W35" <1733709035@qq.com> Date: Wed, 1 Mar 2023 18:08:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/MsgTransmitTools/ExtendLinkModel/HttpServer.meta | 8 ++++++++ .../ExtendLinkModel/TCPServer/Script/SocketServer.cs | 6 +++--- .../{WebSocket.meta => WebSocketServer.meta} | 0 .../{WebSocket => WebSocketServer}/Server.meta | 0 .../Server/MyWebSocketServer.cs | 0 .../Server/MyWebSocketServer.cs.meta | 0 .../{WebSocket => WebSocketServer}/Server/Scenes.meta | 0 .../Server/Scenes/SampleScene.unity | 2 +- .../Server/Scenes/SampleScene.unity.meta | 0 .../Server/WebSocketServer.meta | 0 .../Server/WebSocketServer/WebSocketConnection.cs | 1 + .../Server/WebSocketServer/WebSocketConnection.cs.meta | 0 .../Server/WebSocketServer/WebSocketProtocol.cs | 0 .../Server/WebSocketServer/WebSocketProtocol.cs.meta | 0 .../Server/WebSocketServer/WebSocketServer.cs | 0 .../Server/WebSocketServer/WebSocketServer.cs.meta | 0 16 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 Assets/MsgTransmitTools/ExtendLinkModel/HttpServer.meta rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket.meta => WebSocketServer.meta} (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server.meta (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/MyWebSocketServer.cs (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/MyWebSocketServer.cs.meta (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/Scenes.meta (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/Scenes/SampleScene.unity (99%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/Scenes/SampleScene.unity.meta (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/WebSocketServer.meta (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/WebSocketServer/WebSocketConnection.cs (98%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/WebSocketServer/WebSocketConnection.cs.meta (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/WebSocketServer/WebSocketProtocol.cs (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/WebSocketServer/WebSocketProtocol.cs.meta (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/WebSocketServer/WebSocketServer.cs (100%) rename Assets/MsgTransmitTools/ExtendLinkModel/{WebSocket => WebSocketServer}/Server/WebSocketServer/WebSocketServer.cs.meta (100%) diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer.meta b/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer.meta new file mode 100644 index 0000000..a40883e --- /dev/null +++ b/Assets/MsgTransmitTools/ExtendLinkModel/HttpServer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c88c85318bbb6545a737c48d87ce1fd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/TCPServer/Script/SocketServer.cs b/Assets/MsgTransmitTools/ExtendLinkModel/TCPServer/Script/SocketServer.cs index 75dbc95..a4072df 100644 --- a/Assets/MsgTransmitTools/ExtendLinkModel/TCPServer/Script/SocketServer.cs +++ b/Assets/MsgTransmitTools/ExtendLinkModel/TCPServer/Script/SocketServer.cs @@ -11,7 +11,7 @@ using UnityEngine; public class SocketServer : MonoBehaviour { - int _port = 20000; + int _port = 8443; string _ip = "192.168.1.41"; Thread thread; @@ -91,8 +91,8 @@ public class SocketServer : MonoBehaviour { break; } - string str = Encoding.UTF8.GetString(buffer, 0, len); - Debug.Log("服务器打印:" + socketSend.RemoteEndPoint + ":" + str); + string str = Encoding.ASCII.GetString(buffer, 0, len); + Debug.Log("数据接收:" + socketSend.RemoteEndPoint + ":" + str); Send("我收到了"); } } diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer.meta diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server.meta diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/MyWebSocketServer.cs b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/MyWebSocketServer.cs similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/MyWebSocketServer.cs rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/MyWebSocketServer.cs diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/MyWebSocketServer.cs.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/MyWebSocketServer.cs.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/MyWebSocketServer.cs.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/MyWebSocketServer.cs.meta diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/Scenes.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/Scenes.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/Scenes.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/Scenes.meta diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/Scenes/SampleScene.unity b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/Scenes/SampleScene.unity similarity index 99% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/Scenes/SampleScene.unity rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/Scenes/SampleScene.unity index f41ec8b..728da40 100644 --- a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/Scenes/SampleScene.unity +++ b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/Scenes/SampleScene.unity @@ -234,7 +234,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: address: 192.168.1.41 - port: 20000 + port: 8443 onOpen: m_PersistentCalls: m_Calls: diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/Scenes/SampleScene.unity.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/Scenes/SampleScene.unity.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/Scenes/SampleScene.unity.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/Scenes/SampleScene.unity.meta diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer.meta diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketConnection.cs b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketConnection.cs similarity index 98% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketConnection.cs rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketConnection.cs index 8f88596..f0ebb08 100644 --- a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketConnection.cs +++ b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketConnection.cs @@ -115,6 +115,7 @@ namespace WebSocketServer { } } else { Debug.Log("Framentation encoutered."); + Debug.Log("---------data:"+ Encoding.ASCII.GetString(dataframe.data)); } } } diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketConnection.cs.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketConnection.cs.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketConnection.cs.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketConnection.cs.meta diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketProtocol.cs b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketProtocol.cs similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketProtocol.cs rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketProtocol.cs diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketProtocol.cs.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketProtocol.cs.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketProtocol.cs.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketProtocol.cs.meta diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketServer.cs b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketServer.cs similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketServer.cs rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketServer.cs diff --git a/Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketServer.cs.meta b/Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketServer.cs.meta similarity index 100% rename from Assets/MsgTransmitTools/ExtendLinkModel/WebSocket/Server/WebSocketServer/WebSocketServer.cs.meta rename to Assets/MsgTransmitTools/ExtendLinkModel/WebSocketServer/Server/WebSocketServer/WebSocketServer.cs.meta