Class: TurboRex::Windows::ALPC::Server::ClientStub
- Inherits:
-
Object
- Object
- TurboRex::Windows::ALPC::Server::ClientStub
- Defined in:
- lib/turborex/windows/alpc.rb
Instance Method Summary collapse
- #gets(opts = {}) ⇒ Object (also: #read)
-
#initialize(communication_handle, conn_handle, transport, conn_message) ⇒ ClientStub
constructor
A new instance of ClientStub.
- #puts(message, message_id = nil, opts = {}) ⇒ Object (also: #write)
Constructor Details
#initialize(communication_handle, conn_handle, transport, conn_message) ⇒ ClientStub
Returns a new instance of ClientStub.
690 691 692 693 694 695 696 |
# File 'lib/turborex/windows/alpc.rb', line 690 def initialize(communication_handle, conn_handle, transport, ) @communication_handle = communication_handle @connection_handle = conn_handle @conn_message = @transport = transport @client_id = .client_id end |
Instance Method Details
#gets(opts = {}) ⇒ Object Also known as: read
698 699 700 |
# File 'lib/turborex/windows/alpc.rb', line 698 def gets(opts = {}) @transport.recv(@connection_handle, opts) end |
#puts(message, message_id = nil, opts = {}) ⇒ Object Also known as: write
702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 |
# File 'lib/turborex/windows/alpc.rb', line 702 def puts(, = nil, opts = {}) if .is_a? String = PortMessage.new(payload: ) if opts[:last_header] .header = opts[:last_header] elsif . = else raise "Message ID must be specified when :last_header option is not specified." end elsif .is_a? PortMessage = else raise TurboRex::Exception::ALPC::UnknownPayloadType end = opts.delete(:message_attr) || .attributes @transport.send(@communication_handle, ., , opts) end |