# File lib/daemon/ProcessIntercom.rb, line 87 87: def checkKey(authKey, command) 88: if authKey == @authKey 89: @log.debug("Accepted authentication key for command '#{command}'") 90: else 91: @log.warning("Rejected wrong authentication key #{authKey}" + 92: "for command '#{command}'") 93: return false 94: end 95: true 96: end
# File lib/daemon/ProcessIntercom.rb, line 57 57: def connect(stdout, stderr, stdin, silent) 58: @log.debug('Rerouting ProjectServer standard IO to client') 59: # Make sure that all output to STDOUT and STDERR is sent to the client. 60: # Input is read from the client STDIN. We save a copy of the old file 61: # handles so we can restore then later again. 62: @stdout = $stdout 63: @stderr = $stderr 64: @stdin = $stdin 65: $stdout = stdout 66: $stderr = stderr 67: $stdin = stdin 68: @log.debug('IO is now routed to the client') 69: Log.silent = silent 70: true 71: end
# File lib/daemon/ProcessIntercom.rb, line 73 73: def disconnect 74: @log.debug('Restoring IO') 75: Log.silent = true 76: $stdout = @stdout 77: $stderr = @stderr 78: $stdin = @stdin 79: @log.debug('Standard IO has been restored') 80: true 81: end
# File lib/daemon/ProcessIntercom.rb, line 83 83: def generateAuthKey 84: rand(1000000000).to_s 85: end
# File lib/daemon/ProcessIntercom.rb, line 41 41: def initIntercom 42: # This is the authentication key that clients will need to provide to 43: # execute DRb methods. 44: @authKey = generateAuthKey 45: 46: @log = LogFile.instance 47: # This flag will be set to true by DRb method calls to terminate the 48: # process. 49: @terminate = false 50: end
# File lib/daemon/ProcessIntercom.rb, line 98 98: def startTerminator 99: Thread.new do 100: loop do 101: if @terminate 102: # Give the caller a chance to properly terminate the connection. 103: sleep 1 104: @log.debug('Shutting down DRb server') 105: DRb.stop_service 106: break 107: else 108: sleep 1 109: end 110: end 111: end 112: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.