Top Level Namespace

Defined Under Namespace

Modules: MobME, Net, RPC Classes: RemoteObject

Constant Summary collapse

SyncService =

Alias it

MobME::Infrastructure::RPC

Instance Method Summary collapse

Instance Method Details

#wait_for_client(server_socket) ⇒ Object

Helpers.



15
16
17
18
19
20
21
22
23
24
# File 'lib/rpc/examples/socket-json/server.rb', line 15

def wait_for_client(server_socket)
  # Block for incoming connection from client by accept method.
  # The return value of accept contains the new client socket
  # object and the remote socket address
  client, client_sockaddr = server_socket.accept

  trap(:TERM) { server_socket.close }

  [client, client_sockaddr]
end