Class: Htcp::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/htcp/client.rb

Constant Summary collapse

DEFAULT_PORT =
4827

Instance Method Summary collapse

Constructor Details

#initialize(*servers_list) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/htcp/client.rb', line 7

def initialize(*servers_list)
  @servers = servers_list.flatten
end

Instance Method Details

#clr(url, headers = '') ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/htcp/client.rb', line 11

def clr(url, headers = '')
  message = Htcp::Message::Constructor.new(
    :opcode => Htcp::Message::OpData::Clr::OP_CODE,
    :rd => 0,
    :trans_id => Time.now.to_i,
    :op_data => Htcp::Message::OpData::Clr.new(:uri => url, :headers => headers)
  )
  send_messages(message)
end