Ejemplo n.º 1
0
 public void GoOnline()
 {
     System.Diagnostics.Debug.WriteLine("listening bluetooth");
     this.listener.Start();
     this.isListenening        = true;
     this.clientGetter.Enabled = true;
     GlobalAppEvents.RaiseOnlineEvent(this, new EventArgs());
 }
Ejemplo n.º 2
0
        public void GoOnline()
        {
            int port = ((IPEndPoint)this.listener.LocalEndpoint).Port;

            System.Diagnostics.Debug.WriteLine("listening on port : {0}", port);
            this.listener.Start();
            this.isListenening        = true;
            this.clientGetter.Enabled = true;
            GlobalAppEvents.RaiseOnlineEvent(this, new EventArgs());
        }
Ejemplo n.º 3
0
 private void StartServer()
 {
     if (Properties.Settings.Default.bluetooth)
     {
         try {
             this.server = new BluetoothServer();
             Properties.Settings.Default.bluetooth = true;
             Properties.Settings.Default.Save();
             serverEndpointRepr = this.server.ServerEndpointRepr();
         }
         catch {
             try {
                 MessageBox.Show("failed to use bluetooth");
                 this.server = new TcpServer();
                 Properties.Settings.Default.bluetooth = false;
                 Properties.Settings.Default.Save();
                 serverEndpointRepr = this.server.ServerEndpointRepr();
             }
             catch {
                 MessageBox.Show("and wifi too");
                 throw new Exception("No communication methods availiable");
             }
         }
     }
     else
     {
         try {
             this.server = new TcpServer();
             Properties.Settings.Default.bluetooth = false;
             Properties.Settings.Default.Save();
             serverEndpointRepr = this.server.ServerEndpointRepr();
         }
         catch {
             try {
                 MessageBox.Show("failed to use wifi");
                 this.server = new BluetoothServer();
                 Properties.Settings.Default.bluetooth = true;
                 Properties.Settings.Default.Save();
                 serverEndpointRepr = this.server.ServerEndpointRepr();
             }
             catch {
                 MessageBox.Show("and bluetooth too");
                 throw new Exception("No communication methods availiable");
             }
         }
     }
     this.server.GoOnline();
     GlobalAppEvents.RaiseOnlineEvent(this, new EventArgs());
 }