Inheritance: IDisposable
示例#1
0
            public void Close()
            {
                _streamWatcher.DataAvailible -= StreamWatcherOnDataAvailible;
                _streamWatcher.Stop();
                _streamWatcher = null;

                _socket.Dispose();
            }
示例#2
0
 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() );
     }
 }