netstat.c

lima-1.0b5/lib/cmds/wiz/netstat.c · 428 B

From the archive lima-1.0b5+driver.tar.gz

Download the archive   « Back to the archive contents

/* Do not remove the headers from this file! see /USAGE for more info. */

//:COMMAND
//USAGE: netstat
//
//Displays a list of sockets with (stat) info on each one.

inherit CMD;

private void main()
{
  object * sockets;

  sockets = children(SOCKET);
  if( !sockets || sockets == ({ }) )
  {
      out("No sockets active.\n");
  } else {
    for ( int i = 0; i < sizeof(sockets); i++ )
      out(sockets[i]->stat_me());
  }
}

Site Stats

Snippets: 1791
Codebases: 571