public FakeGangMember( string id, GangSession session = null) { Id = id.GangToBytes(); Session = session ?? GangSession.Default; MessagesReceived = new List <Message>(); }
public WebSocketGangMember( byte[] id, GangSession session, WebSocket webSocket) { Id = id; Session = session; _webSocket = webSocket; _sendQueue = new TaskQueue(); _buffer = new ArraySegment <byte>(new byte[1024 * 4]); }
static async Task <IGangMember> GetGangMemberAsync( GangSession session, HttpContext context ) { return(new WebSocketGangMember( $"{Guid.NewGuid():N}".GangToBytes(), session, await context.WebSockets.AcceptWebSocketAsync() )); }