Class: ItunesController::HelloCommand

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

Overview

The HELO command is used to check that the server is respoinding

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) ⇒ HelloCommand

The constructor

Parameters:



153
154
155
# File 'lib/itunesController/controllserver.rb', line 153

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

Instance Method Details

#processData(line, io) ⇒ Boolean, String

Sends a response to the client “220 ok”

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



163
164
165
# File 'lib/itunesController/controllserver.rb', line 163

def processData(line,io)
    return true, "220 ok\r\n"
end