public MessageChannel AwaitNextConnection() { TcpClient tcpClient = _server.AcceptTcpClient(); var xport = new TcpMessageTransport(tcpClient); var format = new DipMessageFormat(); return new MessageChannel(xport, format); }
public void Start() { TcpClient client = new TcpClient(_hostname, _port); _xport = new TcpMessageTransport(client); _format = new DipMessageFormat(); _channel = new MessageChannel(_xport, _format); _channel.MessageReceived += OnMessageReceived; }
private void PromptTextBox_PreviewTextInput(object sender, TextCompositionEventArgs e) { DipMessageFormat format = new DipMessageFormat(); if (e.Text == "\r") { int consumed = 0; Message msg = format.Decode(Encoding.UTF8.GetBytes(PromptTextBox.Text), out consumed); ConversationViewModel convoVm = _consoleVm.StartConversation(msg); ConversationView convoView = new ConversationView(convoVm); ScrollbackTextBox.Document.Blocks.Add(convoView.View); _conversations.Add(convoView); ScrollbackTextBox.ScrollToEnd(); PromptTextBox.Clear(); e.Handled = true; } }