Example #1
0
            public void Close()
            {
                if (_streamWatcher != null)
                {
                    _streamWatcher.DataAvailible -= StreamWatcherOnDataAvailible;
                    _streamWatcher.Stop();
                    _streamWatcher = null;
                }

                if (_socket != null)
                {
                    _socket.Dispose();
                    _socket = null;
                }
            }
Example #2
0
            public void Close()
            {
                if ( _streamWatcher != null )
                {
                    _streamWatcher.DataAvailible -= StreamWatcherOnDataAvailible;
                    _streamWatcher.Stop();
                    _streamWatcher = null;
                }

                if ( _socket != null )
                {
                    _socket.Dispose();
                    _socket = null;
                }
            }
Example #3
0
 public async Task OpenAsync()
 {
     try
     {
         _socket = new StreamSocket();
         //TODO: HostName only exists on windows phone. Need WinRT solution.
         await _socket.ConnectAsync( _peerInformation.HostName, "1" );
         _streamWatcher = new StreamWatcher( _socket.InputStream );
         _streamWatcher.DataAvailible += StreamWatcherOnDataAvailible;
     }
     catch ( Exception e )
     {
         Debug.WriteLine( e.ToString() );
     }
 }
Example #4
0
            public async Task OpenAsync()
            {
                try
                {
                    _socket = new StreamSocket();
                    //TODO: HostName only exists on windows phone. Need WinRT solution.
                    await _socket.ConnectAsync(_peerInformation.HostName, "1");

                    _streamWatcher = new StreamWatcher(_socket.InputStream);
                    _streamWatcher.DataAvailible += StreamWatcherOnDataAvailible;
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.ToString());
                }
            }