Class: PostgresPR::SSLRequest

Inherits:
Message
  • Object
show all
Defined in:
lib/postgres-pr/message.rb

Constant Summary

Constants inherited from Message

Message::MsgTypeMap

Instance Method Summary collapse

Methods inherited from Message

create, dump, fields, read, register_message_type

Instance Method Details

#dumpObject

Raises:


515
516
517
518
519
520
521
522
# File 'lib/postgres-pr/message.rb', line 515

def dump
  sz = 4 + 4
  buffer = Buffer.of_size(sz)
  buffer.write_int32_network(sz)
  buffer.write_int32_network(@ssl_request_code)
  raise DumpError unless buffer.at_end?
  return buffer.content
end

#parse(buffer) ⇒ Object

Raises:


524
525
526
527
528
# File 'lib/postgres-pr/message.rb', line 524

def parse(buffer)
  buffer.position = 4
  @ssl_request_code = buffer.read_int32_network
  raise ParseError unless buffer.at_end?
end