Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
22 user(s) are online (13 user(s) are browsing Forums)

Members: 0
Guests: 22

more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: Quick networking question

Subject: Re: Quick networking question
by broadblues on 2019/5/7 9:52:00

@Hans

Replied on thread:

here's copy

This code
#include <stdio.h>
 
 
int main
(int argcchar ** argv)
{
    
char host[256];
 
    host
[0] = 0;
 
    gethostname
(host,255);
 
    printf
("host: "%s"n",host); 
}

returns the correct hostname for me

eg

Quote:

ram:testhostname
host: "amiga"


Though that is not not quite what you want as that hostname is local to my SAM 440 on the rest of the network it's defeined as SAM in the various local hosts databases. Using fixed ips on my network so the router doesn't knw the hostnames of the machines.

So what does the hostname command return?

eg here on my SAM I get:
Quote:

10.AmigaOS4:> hostname
amiga

which matches up.

Do you actually want the hostname or the address?


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project