예제 #1
0
 public KcpClient(IKcpSocket client, ISessionListener listen)
 {
     _buffer           = BufferQueue.Allocate(1024 * 32);
     this.socket       = client;
     this._listen      = listen;
     client.onMessage += Socket_onMessage;
 }
예제 #2
0
 // create a new kcp control object, 'conv' must equal in two endpoint
 // from the same connection.
 public Kcp(uint conv_, IKcpSocket sender)
 {
     conv      = conv_;
     snd_wnd   = KcpTool.IKCP_WND_SND;
     rcv_wnd   = KcpTool.IKCP_WND_RCV;
     rmt_wnd   = KcpTool.IKCP_WND_RCV;
     mtu       = KcpTool.IKCP_MTU_DEF;
     mss       = mtu - KcpTool.IKCP_OVERHEAD;
     rx_rto    = KcpTool.IKCP_RTO_DEF;
     rx_minrto = KcpTool.IKCP_RTO_MIN;
     interval  = KcpTool.IKCP_INTERVAL;
     ts_flush  = KcpTool.IKCP_INTERVAL;
     ssthresh  = KcpTool.IKCP_THRESH_INIT;
     dead_link = KcpTool.IKCP_DEADLINK;
     buffer    = new byte[mtu];
     _sender   = sender;
 }