Пример #1
0
 async private void loltest_Click(object sender, RoutedEventArgs e)
 {
     PDU pdu2 = new PDU()
     {
         MessageID = (int)CommandMessageID.StartExecution,
         MessageDescription = "Server Please, load the sequencefile I specified as part of this message.",
         MessageType = "Command",
         Source = "Demo.Client",
         Data = new JObject()
     };
     pdu2.Data.SequenceFileName = "loltest.seq";
     StreamWriter datawr = new StreamWriter(tcpSocket.OutputStream.AsStreamForWrite(), System.Text.Encoding.UTF8);
     char [] trimmer = new char[1];
     trimmer[0] = '.';
     datawr.Flush();
     datawr.Write(pdu2.ToJson());
     recievedTextBox.Text = pdu2.ToJson();
     datawr.Flush();
 }
Пример #2
0
        private async void sendData(PDU k)
        {
            var dr = new DataWriter(newSocket.OutputStream);
            
            //var len = dr.MeasureString(pdu.ToJson());
            String message = k.ToJson();
            //dr.WriteInt32((int)len);
            dr.WriteString(k.ToJson());
            var ret = await dr.StoreAsync();

            recieveData();
            dr.DetachStream();

        }