Class: ItunesController::QuitCommand

Inherits:
ServerCommand show all
Defined in:
lib/itunesController/controllserver.rb

Overview

The QUIT command caused the client to disconnect

Instance Attribute Summary

Attributes inherited from ServerCommand

#name, #requiredLoginState, #singleThreaded

Instance Method Summary collapse

Methods inherited from ServerCommand

#executeSingleThreaded, #processLine

Constructor Details

#initialize(state, itunes) ⇒ QuitCommand

The constructor

Parameters:



174
175
176
# File 'lib/itunesController/controllserver.rb', line 174

def initialize(state,itunes)
    super(ItunesController::CommandName::QUIT,nil,false,state,itunes)
end

Instance Method Details

#processData(line, io) ⇒ Boolean, String

Sends the response to the client “221 bye” and causes the client to disconnect

Parameters:

  • data (String)

    The commands parameters if their are any

  • io

    A IO Stream that is used to talk to the connected client

Returns:

  • (Boolean, String)

    The returned status of the command. If the first part is false, then the server will disconnect the client. The second part is a string message send to the client



184
185
186
# File 'lib/itunesController/controllserver.rb', line 184

def processData(line,io)
    return false, "221 bye\r\n"
end