orca-robotics


INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

REPOSITORY
Interfaces
Components
Libraries
Utilities
Software Map

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard
Wiki
login/pass: orca/orca

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

orca::Pinger Interface Reference
[Pinger]

An interface which provides the well-known ping service. More...

Inherited by pingserver::PingerI.

List of all members.

Public Member Functions

double ping (string hostname) throws PingException


Detailed Description

An interface which provides the well-known ping service.

This is provided as an Ice interface because calling Unix 'ping' requires root priveliges, so it's hard to do from within a large C++ program (assuming you don't want to run the entire executable as super user). This interface allows a small component to be run with root priveliges, and provide this service to other non-superuser components.

AlexB: Seems like a bit of a heavy-handed approach, but I'm not sure how else to do it... An obvious possibility is system("ping") and use some sed/grep magic to pull out the numbers and write to a file, then read the file. This might work but (a) it's brittle and a pain in the arse, and (b) it's hard to get meaningful errors if something goes wrong.


Member Function Documentation

double orca::Pinger::ping string  hostname  )  throws PingException
 

Returns:

  • >=0 : a latency in milliseconds
  • <0 : ping timed out.

Warning:
This function executes in the caller's thread. So it may wait for the ping to time out before returning. So, you should make sure that the Timeout value of the Ice call is larger than the timeout value of the server's ping call.


The documentation for this interface was generated from the following file:
  • pinger.ice
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5