mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Defining a name for a Connection
This commit is contained in:
@@ -156,3 +156,12 @@ std::string NetworkToolkit::closest_host_ip(const std::string &ip)
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
std::string NetworkToolkit::hostname()
|
||||
{
|
||||
char hostname[1024];
|
||||
hostname[1023] = '\0';
|
||||
gethostname(hostname, 1023);
|
||||
|
||||
return std::string(hostname);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user