Module: GamespyQuery::MultiSocket

Includes:
System::Net, System::Net::Sockets
Defined in:
lib/gamespy_query/socket.rb

Overview

TODO

Instance Method Summary collapse

Instance Method Details

#_create_socket(host, port) ⇒ Object



36
37
38
39
40
41
# File 'lib/gamespy_query/socket.rb', line 36

def _create_socket(host, port)
  @ip_end_point = IPEndPoint.new(IPAddress.Any, 0)
  @s = UdpClient.new
  @s.client.receive_timeout = DEFAULT_TIMEOUT * 1000
  @s.connect(host, port.to_i)
end

#_socket_receiveObject



47
48
49
# File 'lib/gamespy_query/socket.rb', line 47

def _socket_receive
  @s.Receive(@ip_end_point)
end

#_socket_send(packet) ⇒ Object



43
44
45
# File 'lib/gamespy_query/socket.rb', line 43

def _socket_send(packet)
  @s.Send(packet, packet.length)
end

#create_socket(*params) ⇒ Object



12
13
14
15
# File 'lib/gamespy_query/socket.rb', line 12

def create_socket(*params)
  Tools.debug {"Creating socket #{params}"}
  _create_socket(*params)
end

#socket_close(*params) ⇒ Object



27
28
29
30
# File 'lib/gamespy_query/socket.rb', line 27

def socket_close(*params)
  Tools.debug {"Closing socket #{params}"}
  @s.close
end

#socket_receive(*params) ⇒ Object



22
23
24
25
# File 'lib/gamespy_query/socket.rb', line 22

def socket_receive(*params)
  Tools.debug {"Receiving socket #{params}"}
  _socket_receive(*params)
end

#socket_send(*params) ⇒ Object



17
18
19
20
# File 'lib/gamespy_query/socket.rb', line 17

def socket_send(*params)
  Tools.debug {"Sending socket #{params}"}
  _socket_send(*params)
end