public ServerConnectionAdapter(IOStream ios, ServerNetworkTableEntryStore sntes, IncomingEntryReceiver ier, ServerAdapterManager sam, NetworkTableEntryTypeManager ntetm, NTThreadManager nttm)
 {
   base.\u002Ector();
   ServerConnectionAdapter connectionAdapter = this;
   this.__\u003C\u003Econnection = new NetworkTableConnection(ios, ntetm);
   this.entryStore = sntes;
   this.transactionReceiver = ier;
   this.adapterListener = sam;
   this.gotoState(ServerConnectionState.__\u003C\u003EGOT_CONNECTION_FROM_CLIENT);
   this.readThread = nttm.newBlockingPeriodicThread((PeriodicRunnable) new ConnectionMonitorThread((ConnectionAdapter) this, this.__\u003C\u003Econnection), "Server Connection Reader Thread");
 }
 public virtual void close(ClientConnectionState ccs)
 {
   lock (this.connectionLock)
   {
     this.gotoState(ccs);
     if (this.readThread != null)
     {
       this.readThread.stop();
       this.readThread = (NTThread) null;
     }
     if (this.connection != null)
     {
       this.connection.close();
       this.connection = (NetworkTableConnection) null;
     }
     this.entryStore.clearIds();
   }
 }
    public virtual void reconnect()
    {
      object obj;
      Monitor.Enter(obj = this.connectionLock);
      // ISSUE: fault handler
      try
      {
        this.close();
        IOStream stream;
        try
        {
          stream = this.streamFactory.createStream();
          if (stream != null)
            goto label_6;
        }
        catch (Exception ex)
        {
          int num = 2;
          if (ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num) == null)
            throw;
          else
            goto label_10;
        }
        Monitor.Exit(obj);
        return;
label_6:
        try
        {
          this.connection = new NetworkTableConnection(stream, this.typeManager);
          this.readThread = this.threadManager.newBlockingPeriodicThread((PeriodicRunnable) new ConnectionMonitorThread((ConnectionAdapter) this, this.connection), "Client Connection Reader Thread");
          this.connection.sendClientHello();
          this.gotoState(ClientConnectionState.__\u003C\u003ECONNECTED_TO_SERVER);
          goto label_15;
        }
        catch (Exception ex)
        {
          int num = 2;
          if (ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num) == null)
            throw;
          else
            goto label_11;
        }
      }
      __fault
      {
        Monitor.Exit(obj);
      }
label_10:
      // ISSUE: variable of the null type
      __Null local = null;
      goto label_12;
label_11:
      local = null;
label_12:
      // ISSUE: fault handler
      try
      {
        this.close();
      }
      __fault
      {
        Monitor.Exit(obj);
      }
label_15:
      // ISSUE: fault handler
      try
      {
        Monitor.Exit(obj);
      }
      __fault
      {
        Monitor.Exit(obj);
      }
    }
 public virtual void start()
 {
   if (this.monitorThread != null)
     this.stop();
   this.monitorThread = this.threadManager.newBlockingPeriodicThread((PeriodicRunnable) this, "Server Incoming Stream Monitor Thread");
 }
예제 #5
0
 public virtual void start()
 {
   if (this.thread != null)
     this.stop();
   this.lastWrite = System.currentTimeMillis();
   this.thread = this.threadManager.newBlockingPeriodicThread((PeriodicRunnable) this, "Write Manager Thread");
 }