public void StationBoard() { testee = new TransportHandler(); var stationBoard = testee.GetStationBoard("Sursee", "8502007"); Assert.IsNotNull(stationBoard); }
public void Connections() { testee = new TransportHandler(); var connections = testee.GetConnections("Sursee", "Luzern", 4); Assert.IsNotNull(connections); }
public void Locations() { testee = new TransportHandler(); var stations = testee.GetStations("Sursee,"); Assert.AreEqual(10, stations.StationList.Count); }
public SimpleServiceHandler(ITransportHandler transportHandler) { _transportHandler = transportHandler; _fileDownloadCommandHandler = new FileDownloadCommandHandler(_transportHandler); _uploadFileCommandHandler = new UploadFileCommandHandler(_transportHandler); _timeCommandHandler = new TimeCommandHandler(_transportHandler); _echoCommandHandler = new EchoCommandHandler(_transportHandler); }
public async Task AcceptConnection(ITransportHandler networkTransportHandler) { var acceptedSocket = await _acceptorListener.AcceptSocketAsync(); _socketOptionsAccessorFactory .GetSocketOptionsAccessor() .SetOptions(acceptedSocket); networkTransportHandler.Activate(acceptedSocket); }
public async Task HandleNewConnection(ITransportHandler transportHandler) { var welcomeMessage = await ReceiveMessage(transportHandler); if (_sessionContexts.TryGetValue(welcomeMessage.ClientId, out var sessionContext)) { } else { var initializeContext = InitializeContext( welcomeMessage.ClientId, welcomeMessage.MessageOptions); _sessionContexts.Add(welcomeMessage.ClientId, initializeContext); } }
public TimeCommandHandler(ITransportHandler transportHandler) { _transportHandler = transportHandler; }
public UploadFileCommandHandler(ITransportHandler transportHandler) { _transportHandler = transportHandler; }
public async Task HandleNewConnection(ITransportHandler transportHandler) { await(new SimpleServiceHandler(transportHandler)).StartReceive(); }
public FileDownloadCommandHandler(ITransportHandler transportHandler) { _transportHandler = transportHandler; }
private async Task <WelcomeMessage> ReceiveMessage(ITransportHandler transportHandler) { return(_byteSerializer.Deserialize <WelcomeMessage>(await transportHandler.ReceiveAllAvailable())); }
public EchoCommandHandler(ITransportHandler transportHandler) { _transportHandler = transportHandler; }