资源简介
服务器和客户端全套源码,经测试,收发消息都正常
代码片段和文件信息
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Net.Sockets;
public class ClientHandler : MonoBehaviour
{
const int portNo = 8888;
private TcpClient _client;
byte[] data;
public string nickName = ““;
public string message = ““;
public string sendMsg = ““;
void OnGUI()
{
nickName = GUI.TextField(new Rect(10 10 100 20) nickName);
message = GUI.TextArea(new Rect(10 40 300 200) message);
sendMsg = GUI.TextField(new Rect(10 250 210 20) sendMsg);
if (GUI.Button(new Rect(120 10 80 20) “Connect“))
{
//Debug.Log(“hello“);
this._client = new TcpClient();
this._client.Connect(“192.168.1.28“ portNo);
data = new byte[this._client.ReceiveBufferSize];
//SendMessage(txtNick.Text);
SendMessage(nickName);
this._client.GetStream().BeginRead(data 0 System.Convert.ToInt32(this._client.ReceiveBufferSize) ReceiveMessage null);
};
if (GUI.But
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3099 2016-12-04 20:02 socketPoject\socketClient\Assembly-CSharp-vs.csproj
文件 4278 2016-12-05 09:19 socketPoject\socketClient\Assembly-CSharp.csproj
文件 1891 2016-12-05 09:38 socketPoject\socketClient\Assets\ClientHandler.cs
..A..H. 178 2016-12-04 14:37 socketPoject\socketClient\Assets\ClientHandler.cs.me
文件 2383 2016-12-04 20:03 socketPoject\socketClient\Assets\SocketClient.cs
..A..H. 178 2016-12-04 20:01 socketPoject\socketClient\Assets\SocketClient.cs.me
I.A.... 13888 2016-12-05 10:12 socketPoject\socketClient\Assets\socketClient.unity
..A..H. 90 2016-12-04 19:43 socketPoject\socketClient\Assets\socketClient.unity.me
文件 4120 2016-12-04 14:37 socketPoject\socketClient\Library\AnnotationManager
I.A.... 1562764 2016-12-05 10:12 socketPoject\socketClient\Library\assetDataba
I.A.... 8 2016-12-05 09:19 socketPoject\socketClient\Library\AssetImportState
I.A.... 4756 2016-12-05 10:12 socketPoject\socketClient\Library\AssetServerCacheV3
I.A.... 0 2016-12-04 14:37 socketPoject\socketClient\Library\BuildPla
文件 4120 2016-12-04 14:37 socketPoject\socketClient\Library\BuildSettings.asset
I.A.... 50612 2016-12-05 10:12 socketPoject\socketClient\Library\CurrentLayout.dwlt
文件 32456 2016-12-04 19:14 socketPoject\socketClient\Library\CurrentMaximizeLayout.dwlt
文件 4184 2016-12-04 14:37 socketPoject\socketClient\Library\EditorUserBuildSettings.asset
文件 4140 2016-12-04 14:37 socketPoject\socketClient\Library\EditorUserSettings.asset
I.A.... 4140 2016-12-05 10:12 socketPoject\socketClient\Library\expandedItems
文件 0 2016-12-04 20:57 socketPoject\socketClient\Library\FailedAssetImports.txt
文件 4132 2016-12-04 20:57 socketPoject\socketClient\Library\InspectorExpandedItems.asset
I.A.... 75 2016-12-05 10:12 socketPoject\socketClient\Library\LastSceneManagerSetup.txt
I.A.... 65 2016-12-05 09:19 socketPoject\socketClient\Library\LibraryFormatVersion.txt
I.A.... 4285 2016-12-05 09:19 socketPoject\socketClient\Library\me
文件 556 2016-12-05 09:19 socketPoject\socketClient\Library\me
I.A.... 4321 2016-12-05 09:19 socketPoject\socketClient\Library\me
文件 554 2016-12-05 09:19 socketPoject\socketClient\Library\me
I.A.... 4313 2016-12-05 09:19 socketPoject\socketClient\Library\me
文件 552 2016-12-05 09:19 socketPoject\socketClient\Library\me
I.A.... 4325 2016-12-05 10:12 socketPoject\socketClient\Library\me
............此处省略769个文件信息
- 上一篇:空压机传输通讯协议
- 下一篇:数据结构课程设计:学生成绩管理系统
相关资源
- Location虚拟定位ios12.1破解版.zip
- 流体模拟插件NextLimitRealFlowC4D2.6.5.00
- 老虎淘宝客v6.0.15.zip
- iSkysoft Video Converter Ultimate 5.1简体中文
- 20180704全彩种彩票网站源码.rar
- 暗影2MAC12系统安装clover.zip
- fdt_4_09_03.exe
- pkg-win.zip
- PRML最全资料集合.zip
- 数据可视化驾驶舱.zip
- 李晓峰通信原理.zip
- 图解西门子S71200PLC入门到实践(清晰
- AI拓客商家联盟V2.1.3前端+后端.rar
- echarts大数据领导仓demo.rar
- [C51单片机开发工具Keil.UV4].Keil.C51.V9
- Deep_Learning_2016.pdf
- zw_Classification1.zip
- Griffiths-IntroductiontoElectrodynamics4thEdit
- ParaViewTutorial.pdf
- xyisv_10236804.zip
- 计算机图形学第4版高清电子书.pdf
- 《多粒度知识获取与不确定性度量》
- 华成英模电课件.zip
- 70d0cd041f738f12db575d3b46e97582.pdf
- OfficeTabEnterprise13.1.zip
- wxu998.rar
- PowerDesigner16.5汉化文件.rar
- jsgis.zip
- PinyinIME(关键代码写了注释).zip
- 锁相环设计、仿真与应用第5版中.pd
评论
共有 条评论