Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

void LocalAddress::Main (  ) [virtual]

User override function for the main execution routine of the thread. A descendent class must provide the code that will be executed in the thread within this function.

Note that the correct way for a thread to terminate is to return from this function.

Implements PThread.

Definition at line 42 of file local.cxx.

References PIPSocket::Address::AsString(), PIPSocket::GetHostName(), PProcess::GetManufacturer(), PProcess::GetName(), PIPSocket::GetNetworkInterface(), PProcess::GetOSHardware(), PProcess::GetOSName(), PProcess::GetOSVersion(), and PProcess::GetVersion().

{
    PStringStream progName;
    progName << "Product Name: " << GetName() << endl
             << "Manufacturer: " << GetManufacturer() << endl
             << "Version     : " << GetVersion(TRUE) << endl
             << "System      : " << GetOSName() << '-'
             << GetOSHardware() << ' '
             << GetOSVersion();
    cout << endl <<  progName << endl << endl;
    

    PUDPSocket localSocket;
    PIPSocket::Address addr;
    if(localSocket.GetNetworkInterface(addr)) {
        cout << "local address is    " << addr.AsString() << endl;
        if (addr == 0)
            cout << "sorry, that is a 0.0.0.0 address" << endl;
    } else
      cout << "Sorry, failed to get local address" << endl;
    
    cout << "local host name is  " << localSocket.GetHostName() << endl;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index