Module: GamespyQuery::MultiSocket
- Includes:
- System::Net, System::Net::Sockets
- Defined in:
- lib/gamespy_query/socket.rb
Overview
TODO
Instance Method Summary collapse
- #_create_socket(host, port) ⇒ Object
- #_socket_receive ⇒ Object
- #_socket_send(packet) ⇒ Object
- #create_socket(*params) ⇒ Object
- #socket_close(*params) ⇒ Object
- #socket_receive(*params) ⇒ Object
- #socket_send(*params) ⇒ Object
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_receive ⇒ Object
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 |