def disconnect(self):
      """
      This method disconnects an IOM session to allow for reconnecting when switching networks
      """

      if not self.sascfg.reconnect:
         return "Disconnecting and then reconnecting to this workspaceserver has been disabled. Did not disconnect"

      pgm = b'\n'+b'tom says EOL=DISCONNECT                      \n'
      self.stdin[0].send(pgm)

      while True:
         try:
            log = self.stderr[0].recv(4096).decode(errors='replace')
         except (BlockingIOError):
            log = b''

         if len(log) > 0:
            if log.count("DISCONNECT") >= 1:
               break

      return log.rstrip("DISCONNECT")
def disconnect ( self ) : if not self . sascfg . reconnect : return "Disconnecting and then reconnecting to this workspaceserver has been disabled. Did not disconnect" pgm = b'\n' + b'tom says EOL=DISCONNECT                      \n' self . stdin [ 0 ] . send ( pgm ) while True : try : log = self . stderr [ 0 ] . recv ( 4096 ) . decode ( errors = 'replace' ) except ( BlockingIOError ) : log = b'' if len ( log ) > 0 : if log . count ( "DISCONNECT" ) >= 1 : break return log . rstrip ( "DISCONNECT" )
This method disconnects an IOM session to allow for reconnecting when switching networks