public void ProcessAccept(SocketAsyncEventArgs e) { UserToken token = pool.pop(); token.conn = e.AcceptSocket; StartReceive(token); StartAccept(e); }
public void ProcessAccept(SocketAsyncEventArgs e) { //从连接对象池取出连接对象 供新用户使用 UserToken token = pool.pop(); token.conn = e.AcceptSocket; //TODO 通知应用层 有客户端连接 center.ClientConnect(token); //开启消息到达监听 StartReceive(token); //释放当前异步对象 StartAccept(e); }
void ProcessAccept(SocketAsyncEventArgs e) { UserToken token = pool.pop();//分配一个链接对象 token.conn = e.AcceptSocket; //TODO通知应用层有客户端连接 center.ClientConnect(token); //开启消息到达监听 StartReceive(token); //释放当前异步对象 StartAccept(e);//把当前异步事件释放,等待下次连接 }
public void ProcessAccept(SocketAsyncEventArgs e) { UserToken token = pool.pop(); token.conn = e.AcceptSocket; //TO Do 通知应用层有客户连接 center.ClientConnent(token); //开启消息到达监听 StartReceive(token); //释放当前异步对象 StartAccept(e); }
public void ProcessAccept(SocketAsyncEventArgs e) { UserToken token = pool.pop(); }