/// <summary> /// 构建一个Tcp连接器 /// </summary> /// <param name="hostname">IP地址</param> /// <param name="port">链接端口</param> public TcpConnector(string hostname, int port) { remoteHostname = hostname; remotePort = port; status = Status.Initial; emmiter = new Emmiter(); }
/// <summary> /// Kcp连接器 /// </summary> /// <param name="conv">会话</param> /// <param name="hostname">IP地址</param> /// <param name="port">链接端口</param> public KcpConnector(uint conv, string hostname, int port) { status = Status.Initial; emmiter = new Emmiter(); this.conv = conv; remoteHostname = hostname; remotePort = port; SendWindow = 128; RecvWindow = 128; NoDelay = true; IntervalTimer = 10; Resend = 2; CongestionControl = true; }