public Session(NetworkComponent netcom, AChannel ch) { //this.Id = IdGenerater.GenerateId(); this.network = netcom; this.channel = ch; this.requestCallback.Clear(); this.StartRecvAsync(); }
public virtual async Task <AChannel> Accept() { AChannel channel = await this.Service.AcceptChannelAsync(); Session session = new Session(this, channel); this.AddSession(session); channel.ErrorCallback += (c, e) => { this.RemoveSession(session.Id); }; channel.ErrorCallback += OnNetworkError; return(channel); }
protected void OnError(AChannel channel, SocketError e) { this.errorCallback?.Invoke(channel, e); }
private void OnNetworkError(AChannel channel, SocketError error) { Log.Error($"ChannelError: {channel.Id}: {error.ToString()}"); }