Thread View: comp.object.corba
3 messages
3 total messages
Started by Sander van Geloven
Sun, 14 Mar 1999 00:00
How can a CORBA client find its own hostname
Author: Sander van Geloven
Date: Sun, 14 Mar 1999 00:00
Date: Sun, 14 Mar 1999 00:00
8 lines
868 bytes
868 bytes
Hi, Does anyone know how a CORBA client can find its own hostname. I am looking for a short example. Thanks, Sander
Re: How can a CORBA client find its own hostname
Author: Todd Graham Lewis
Date: Mon, 15 Mar 1999 00:00
Date: Mon, 15 Mar 1999 00:00
25 lines
1515 bytes
1515 bytes
On Sun, 14 Mar 1999, Sander van Geloven wrote:
> Does anyone know how a CORBA client can find its own hostname. I am
> looking for a short example.
Not CORBA, unix!
#include <sys/utsname.h>
#include <string.h>
struct utsname foo;
char * nodename;
size_t bar;
if(!uname(&foo)){
bar=strlen(foo.nodename);
nodename=(char *)malloc(bar);
strncpy(nodename, foo.nodename, bar);
}
--
Todd Graham Lewis 32�49'N,83�36'W (800) 719-4664, x22804
******Linux****** MindSpring Enterprises tlewis@mindspring.net
"A pint of sweat will save a gallon of blood." -- George S. Patton
Re: How can a CORBA client find its own hostname
Author: Brian Courtney
Date: Wed, 24 Mar 1999 00:00
Date: Wed, 24 Mar 1999 00:00
34 lines
1861 bytes
1861 bytes
Using OrbixWeb
String myHost = _CORBA.Orbix.myHost();
Brian
Todd Graham Lewis wrote:
> On Sun, 14 Mar 1999, Sander van Geloven wrote:
>
> > Does anyone know how a CORBA client can find its own hostname. I am
> > looking for a short example.
>
> Not CORBA, unix!
>
> #include <sys/utsname.h>
> #include <string.h>
>
> struct utsname foo;
> char * nodename;
> size_t bar;
>
> if(!uname(&foo)){
> bar=strlen(foo.nodename);
> nodename=(char *)malloc(bar);
> strncpy(nodename, foo.nodename, bar);
> }
>
> --
> Todd Graham Lewis 32�49'N,83�36'W (800) 719-4664, x22804
> ******Linux****** MindSpring Enterprises tlewis@mindspring.net
>
> "A pint of sweat will save a gallon of blood." -- George S. Patton
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads