初始化版本
This commit is contained in:
151
tongxin/NetWorkHelper/TClass/ClientType.cs
Normal file
151
tongxin/NetWorkHelper/TClass/ClientType.cs
Normal file
@@ -0,0 +1,151 @@
|
||||
/********************************************************************
|
||||
* *
|
||||
* * Copyright (C) 2013-? Corporation All rights reserved.
|
||||
* * 作者: BinGoo QQ:315567586
|
||||
* * 请尊重作者劳动成果,请保留以上作者信息,禁止用于商业活动。
|
||||
* *
|
||||
* * 创建时间:2014-08-05
|
||||
* * 说明:客户端类型管理
|
||||
* *
|
||||
********************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace NetWorkHelper.TClass
|
||||
{
|
||||
public enum ClientType
|
||||
{
|
||||
/// <summary>
|
||||
/// 小车客户端
|
||||
/// </summary>
|
||||
[Description("小车客户端")]
|
||||
CarType = 0,
|
||||
/// <summary>
|
||||
/// 轨道列车客户端
|
||||
/// 包括(火车、地铁、高铁、动车)
|
||||
/// </summary>
|
||||
[Description("轨道列车客户端")]
|
||||
TrainType = 1,
|
||||
/// <summary>
|
||||
/// 轨道监控PC客户端
|
||||
/// </summary>
|
||||
[Description("轨道监控PC客户端")]
|
||||
TrainPcType = 2,
|
||||
/// <summary>
|
||||
/// Led客户端
|
||||
/// </summary>
|
||||
[Description("信号机客户端")]
|
||||
LedType = 3,
|
||||
/// <summary>
|
||||
/// 监控调度客户端
|
||||
/// </summary>
|
||||
[Description("监控调度客户端")]
|
||||
GpsClientType = 4,
|
||||
/// <summary>
|
||||
/// 信号机PC客户端
|
||||
/// </summary>
|
||||
[Description("信号机PC客户端")]
|
||||
PcUtcClientType = 5,
|
||||
/// <summary>
|
||||
///公交服务客户端
|
||||
/// </summary>
|
||||
[Description("公交服务客户端")]
|
||||
BusServerType = 6,
|
||||
/// <summary>
|
||||
/// 沙盘建筑背景灯控制客户端
|
||||
/// </summary>
|
||||
[Description("建筑灯客户端")]
|
||||
PcLampClient = 7,
|
||||
/// <summary>
|
||||
/// 沙盘建筑背景灯客户端
|
||||
/// </summary>
|
||||
[Description("建筑灯PC客户端")]
|
||||
LampClient = 8,
|
||||
/// <summary>
|
||||
/// 升降杆客户端
|
||||
/// </summary>
|
||||
[Description("升降杆客户端")]
|
||||
MotorClient = 9,
|
||||
/// <summary>
|
||||
/// 无标记
|
||||
/// </summary>
|
||||
[Description("未知")]
|
||||
None = 10,
|
||||
/// <summary>
|
||||
/// 华软客户端
|
||||
/// </summary>
|
||||
[Description("华软客户端")]
|
||||
HuaRuan = 11,
|
||||
/// <summary>
|
||||
/// 电子警察客户端
|
||||
/// </summary>
|
||||
[Description("电子警察客户端")]
|
||||
ElectronicPoliceClient = 12,
|
||||
/// <summary>
|
||||
/// 硬件地磁客户端
|
||||
/// </summary>
|
||||
[Description("硬件地磁客户端")]
|
||||
Geomagnetic = 13,
|
||||
/// <summary>
|
||||
/// 网页地磁客户端
|
||||
/// </summary>
|
||||
[Description("网页地磁客户端")]
|
||||
WebGeomagnetic = 14,
|
||||
/// <summary>
|
||||
/// andorid手机地磁客户端
|
||||
/// </summary>
|
||||
[Description(" Andorid手机地磁客户端")]
|
||||
AndroidGeomagnetic = 15,
|
||||
/// <summary>
|
||||
///PC版地磁客户端
|
||||
/// </summary>
|
||||
[Description("地磁PC客户端")]
|
||||
PcGeomagnetic = 16,
|
||||
/// <summary>
|
||||
///车辆监控客户端
|
||||
/// </summary>
|
||||
[Description("车辆监控客户端")]
|
||||
CarMonitor = 17,
|
||||
/// <summary>
|
||||
///公交站闸机客户端
|
||||
/// </summary>
|
||||
[Description("公交站闸机客户端")]
|
||||
RfidDoor = 18,
|
||||
/// <summary>
|
||||
///上海电气客户端
|
||||
/// </summary>
|
||||
[Description("上海电气客户端")]
|
||||
ShangHaiDianQi = 19,
|
||||
/// <summary>
|
||||
/// 电子警察闪关灯客户端
|
||||
/// </summary>
|
||||
[Description("电子警察闪关灯客户端")]
|
||||
ElectronicPoliceFlashLamp = 20,
|
||||
/// <summary>
|
||||
/// 停车场收费客户端
|
||||
/// </summary>
|
||||
[Description("停车场收费客户端")]
|
||||
ParkingChargeClient = 21,
|
||||
/// <summary>
|
||||
/// 新版调度监控客户端
|
||||
/// </summary>
|
||||
[Description("新版调度监控客户端")]
|
||||
DispatchClient = 22,
|
||||
/// <summary>
|
||||
/// 立体车库PC控制端
|
||||
/// </summary>
|
||||
[Description("立体车库PC控制端")]
|
||||
PcStereoGarage = 23,
|
||||
/// <summary>
|
||||
/// 立体车库硬件
|
||||
/// </summary>
|
||||
[Description("立体车库硬件")]
|
||||
StereoGarage = 24,
|
||||
|
||||
/// <summary>
|
||||
/// 模拟驾驶客户端
|
||||
/// </summary>
|
||||
[Description("模拟驾驶客户端")]
|
||||
VideoDrive = 25
|
||||
}
|
||||
}
|
||||
39
tongxin/NetWorkHelper/TClass/ControlTag.cs
Normal file
39
tongxin/NetWorkHelper/TClass/ControlTag.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Net;
|
||||
|
||||
namespace NetWorkHelper
|
||||
{
|
||||
internal class ControlTag
|
||||
{
|
||||
private string _md5;
|
||||
private string _fileName;
|
||||
private IPEndPoint _remoteIP;
|
||||
|
||||
public ControlTag(
|
||||
string md5,
|
||||
string fileName,
|
||||
IPEndPoint remoteIP)
|
||||
{
|
||||
_md5 = md5;
|
||||
_fileName = fileName;
|
||||
_remoteIP = remoteIP;
|
||||
}
|
||||
|
||||
public string MD5
|
||||
{
|
||||
get { return _md5; }
|
||||
set { _md5 = value; }
|
||||
}
|
||||
|
||||
public string FileName
|
||||
{
|
||||
get { return _fileName; }
|
||||
set { _fileName = value; }
|
||||
}
|
||||
|
||||
public IPEndPoint RemoteIP
|
||||
{
|
||||
get { return _remoteIP; }
|
||||
set { _remoteIP = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
183
tongxin/NetWorkHelper/TClass/EnumClass.cs
Normal file
183
tongxin/NetWorkHelper/TClass/EnumClass.cs
Normal file
@@ -0,0 +1,183 @@
|
||||
/********************************************************************
|
||||
* *
|
||||
* * Copyright (C) 2013-? Corporation All rights reserved.
|
||||
* * 作者: BinGoo QQ:315567586
|
||||
* * 请尊重作者劳动成果,请保留以上作者信息,禁止用于商业活动。
|
||||
* *
|
||||
* * 创建时间:2014-08-05
|
||||
* * 说明:
|
||||
* *
|
||||
********************************************************************/
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace NetWorkHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Socket状态枚举
|
||||
/// </summary>
|
||||
public enum SocketState
|
||||
{
|
||||
/// <summary>
|
||||
/// 正在连接服务端
|
||||
/// </summary>
|
||||
Connecting = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 已连接服务端
|
||||
/// </summary>
|
||||
Connected = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 重新连接服务端
|
||||
/// </summary>
|
||||
Reconnection = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 断开服务端连接
|
||||
/// </summary>
|
||||
Disconnect = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 正在监听
|
||||
/// </summary>
|
||||
StartListening = 4,
|
||||
/// <summary>
|
||||
/// 启动监听异常
|
||||
/// </summary>
|
||||
StartListeningError = 5,
|
||||
/// <summary>
|
||||
/// 停止监听
|
||||
/// </summary>
|
||||
StopListening = 6,
|
||||
|
||||
/// <summary>
|
||||
/// 客户端上线
|
||||
/// </summary>
|
||||
ClientOnline = 7,
|
||||
|
||||
/// <summary>
|
||||
/// 客户端下线
|
||||
/// </summary>
|
||||
ClientOnOff = 8
|
||||
}
|
||||
/// <summary>
|
||||
/// 错误类型
|
||||
/// </summary>
|
||||
public enum SocketError
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送接收命令枚举
|
||||
/// </summary>
|
||||
public enum Command
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 发送请求接收文件
|
||||
/// </summary>
|
||||
RequestSendFile = 0x000001,
|
||||
/// <summary>
|
||||
/// 响应发送请求接收文件
|
||||
/// </summary>
|
||||
ResponeSendFile = 0x100001,
|
||||
|
||||
/// <summary>
|
||||
/// 请求发送文件包
|
||||
/// </summary>
|
||||
RequestSendFilePack = 0x000002,
|
||||
/// <summary>
|
||||
/// 响应发送文件包
|
||||
/// </summary>
|
||||
ResponeSendFilePack = 0x100002,
|
||||
|
||||
/// <summary>
|
||||
/// 请求取消发送文件包
|
||||
/// </summary>
|
||||
RequestCancelSendFile = 0x000003,
|
||||
/// <summary>
|
||||
/// 响应取消发送文件包
|
||||
/// </summary>
|
||||
ResponeCancelSendFile = 0x100003,
|
||||
|
||||
/// <summary>
|
||||
/// 请求取消接收发送文件
|
||||
/// </summary>
|
||||
RequestCancelReceiveFile = 0x000004,
|
||||
/// <summary>
|
||||
/// 响应取消接收发送文件
|
||||
/// </summary>
|
||||
ResponeCancelReceiveFile = 0x100004,
|
||||
/// <summary>
|
||||
/// 请求发送文本消息
|
||||
/// </summary>
|
||||
RequestSendTextMSg = 0x000010,
|
||||
}
|
||||
/// <summary>
|
||||
/// 消息类型
|
||||
/// </summary>
|
||||
public enum MsgType
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本消息
|
||||
/// </summary>
|
||||
TxtMsg = 0,
|
||||
/// <summary>
|
||||
/// 抖动窗体
|
||||
/// </summary>
|
||||
Shake = 1,
|
||||
/// <summary>
|
||||
/// 表情
|
||||
/// </summary>
|
||||
Face = 2,
|
||||
/// <summary>
|
||||
/// 图片
|
||||
/// </summary>
|
||||
Pic = 3
|
||||
}
|
||||
public enum ClientStyle
|
||||
{
|
||||
WebSocket,
|
||||
PcSocket
|
||||
}
|
||||
public enum LogType
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统
|
||||
/// </summary>
|
||||
[Description("系统日志")]
|
||||
System,
|
||||
|
||||
/// <summary>
|
||||
/// 服务端
|
||||
/// </summary>
|
||||
[Description("服务端类型日志")]
|
||||
Server,
|
||||
|
||||
/// <summary>
|
||||
/// 客户端
|
||||
/// </summary>
|
||||
[Description("客户端类型日志")]
|
||||
Client,
|
||||
|
||||
/// <summary>
|
||||
/// 发送数据
|
||||
/// </summary>
|
||||
[Description("发送数据类型日志")]
|
||||
SendData,
|
||||
|
||||
/// <summary>
|
||||
/// 接收数据
|
||||
/// </summary>
|
||||
[Description("接收数据类型日志")]
|
||||
ReceviedData,
|
||||
|
||||
/// <summary>
|
||||
/// 发送数据返回结果
|
||||
/// </summary>
|
||||
[Description("发送数据返回结果类型日志")]
|
||||
SendDataResult
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user