class Rsws

The class of the server

Public Class Methods

new(init_port) click to toggle source
# File lib/rsws.rb, line 146
def initialize(init_port)
  @port = init_port
  @server = TCPServer.new @port
end

Public Instance Methods

run() { |client| ... } click to toggle source

Where most of the logic happens

# File lib/rsws.rb, line 152
def run
  loop do
    client_sock = @server.accept
    client = Rsws_client.new(client_sock)
    yield client
  end
end