private void ConnectionReceived(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args) { HasConnection = true; var socket = new ComplexStreamSocket(args.Socket); StartStreaming(socket); HasConnection = false; }
private bool Stream(ComplexStreamSocket socket) { bool continueStreaming = true; try { var message = socket.DataReader.GetMessage(); var result = _actions.Response(message); Debug.WriteLine("Sending " + message); continueStreaming = socket.DataWriter.WriteMessage(result); } catch (Exception exception) { continueStreaming = false; Debug.WriteLine(SocketError.GetStatus(exception.HResult)); } return continueStreaming; }
void StartStreaming(ComplexStreamSocket socket) { while (Stream(socket)); }
public StreamRequester() { _socket = new ComplexStreamSocket(new StreamSocket()); }