Method: OpenC3::TcpipServerInterface#num_clients

Defined in:
lib/openc3/interfaces/tcpip_server_interface.rb

#num_clientsInteger

Returns The number of connected clients.

Returns:

  • (Integer)

    The number of connected clients



260
261
262
263
264
265
# File 'lib/openc3/interfaces/tcpip_server_interface.rb', line 260

def num_clients
  interfaces = []
  @write_interface_infos.each { |wii| interfaces << wii.interface }
  @read_interface_infos.each { |rii| interfaces << rii.interface }
  interfaces.uniq.length
end