Method: SteamSocket#initialize

Defined in:
lib/steam/sockets/steam_socket.rb

#initialize(ip_address, port = 27015) ⇒ Object

Creates a new UDP socket to communicate with the server on the given IP address and port

Parameters:

  • ip_address (String)

    Either the IP address or the DNS name of the server

  • port (Fixnum) (defaults to: 27015)

    The port the server is listening on



38
39
40
41
# File 'lib/steam/sockets/steam_socket.rb', line 38

def initialize(ip_address, port = 27015)
  @socket = UDPSocket.new
  @socket.connect ip_address, port
end