Sha256: e6bc125a379c74d89c7d5f036d72b528231389485b4723b1f7aa941cc2ebb5b2

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

# FIMXE: following class must modify the fd_watchlist thats being monitored by
# main eventloop.

module Packet
  module Connection
    def send_data p_data
      begin
        write_data(p_data,connection)
      rescue DisconnectError => sock_error
        close_connection
      end
    end

    def invoke_init
      @initialized = true
      post_init if respond_to?(:post_init)
    end

    def close_connection
      unbind if respond_to?(:unbind)
      reactor.remove_connection(connection)
    end

    def close_connection_after_writing
      connection.flush
      close_connection
    end

    def send_object p_object
      dump_object(p_object,connection)
    end
  end # end of class Connection
end # end of module Packet

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
packet-0.1.1 lib/connection.rb
packet-0.1.2 lib/connection.rb