public void Close() { _streamWatcher.DataAvailible -= StreamWatcherOnDataAvailible; _streamWatcher.Stop(); _streamWatcher = null; _socket.Dispose(); }
public async Task OpenAsync() { try { await _socket.ConnectAsync( _PeerInformation.HostName, "1" ); _streamWatcher = new StreamWatcher( _socket.InputStream ); _streamWatcher.DataAvailible += StreamWatcherOnDataAvailible; } catch ( Exception e ) { Debug.WriteLine( e.ToString() ); } }