Exemple #1
0
 public ChatServer(IChatBot chatBot, IChatStreamOperator streamOperator, ServerSettings settings)
 {
     if (settings == null)
     {
         throw new ArgumentNullException(nameof(settings));
     }
     _chatBot        = chatBot ?? throw new ArgumentNullException(nameof(chatBot));
     _streamOperator = streamOperator ?? throw new ArgumentNullException(nameof(streamOperator));
     _listener       = new TcpListener(settings.EndPoint);
 }
Exemple #2
0
 public ExchangeClient(ServerSettings settings, IChatStreamOperator streamOperator, IServerAnswerFactory answerFactory)
 {
     _settings       = settings ?? throw new ArgumentNullException(nameof(settings));
     _streamOperator = streamOperator ?? throw new ArgumentNullException(nameof(streamOperator));
     _answerFactory  = answerFactory ?? throw new ArgumentNullException(nameof(answerFactory));
 }