module GioTestUtils::SocketClient

Public Instance Methods

setup_client() click to toggle source
# File gio2/test/gio2-test-utils/socket-client.rb, line 43
def setup_client
  @client = Gio::SocketClient.new
  @connection = @client.connect_to_host(@host, @port)
end
setup_loop() click to toggle source
# File gio2/test/gio2-test-utils/socket-client.rb, line 52
def setup_loop
  @loop = GLib::MainLoop.new
end
setup_server() click to toggle source
# File gio2/test/gio2-test-utils/socket-client.rb, line 33
def setup_server
  @host = "127.0.0.1"
  @server = TCPServer.new(@host, 0)
  @port = @server.addr[1]
end
setup_socket_client() click to toggle source
# File gio2/test/gio2-test-utils/socket-client.rb, line 21
def setup_socket_client
  setup_server
  setup_client
  setup_loop
end
teardown_client() click to toggle source
# File gio2/test/gio2-test-utils/socket-client.rb, line 48
def teardown_client
  @connection.close
end
teardown_loop() click to toggle source
# File gio2/test/gio2-test-utils/socket-client.rb, line 56
def teardown_loop
end
teardown_server() click to toggle source
# File gio2/test/gio2-test-utils/socket-client.rb, line 39
def teardown_server
  @server.close
end
teardown_socket_client() click to toggle source
# File gio2/test/gio2-test-utils/socket-client.rb, line 27
def teardown_socket_client
teardown_loop
teardown_client
teardown_server
end