File was renamed from HDL_ON/DAL/Net/TcpListener.cs |
| | |
| | | /* |
| | | * 该类用于管理tcp连接通讯 |
| | | * 该类用于管理tcp作为服务端连接通讯 |
| | | */ |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | using Shared; |
| | | using HDL_ON.Entity; |
| | | |
| | | namespace HDL_ON.DAL.Net |
| | | namespace HDL_ON.DriverLayer |
| | | { |
| | | /// <summary> |
| | | /// 服务端 |
| | | /// TCP服务端 |
| | | /// </summary> |
| | | public class TcpListener |
| | | public class Control_TcpServer |
| | | { |
| | | |
| | | private Socket ServerSocket = null;//服务端 |
| | | public Dictionary<string, MySession> dic_ClientSocket = new Dictionary<string, MySession>();//tcp客户端字典 |
| | | private Dictionary<string, Thread> dic_ClientThread = new Dictionary<string, Thread>();//线程字典,每新增一个连接就添加一条线程 |
| | |
| | | /// 启动服务 |
| | | /// </summary> |
| | | /// <param name="port">端口号</param> |
| | | public bool OpenServer(int port) |
| | | public bool OpenServer(int port = 8586) |
| | | { |
| | | try |
| | | { |