File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,13 @@ int main() {
32
32
}
33
33
34
34
// Show the network address
35
- const char *ip = net->get_ip_address ();
36
- const char *netmask = net->get_netmask ();
37
- const char *gateway = net->get_gateway ();
38
- printf (" IP address: %s\n " , ip ? ip : " None" );
39
- printf (" Netmask: %s\n " , netmask ? netmask : " None" );
40
- printf (" Gateway: %s\n " , gateway ? gateway : " None" );
35
+ SocketAddress a;
36
+ net->get_ip_address (&a);
37
+ printf (" IP address: %s\n " , a.get_ip_address () ? a.get_ip_address () : " None" );
38
+ net->get_netmask (&a);
39
+ printf (" Netmask: %s\n " , a.get_ip_address () ? a.get_ip_address () : " None" );
40
+ net->get_gateway (&a);
41
+ printf (" Gateway: %s\n " , a.get_ip_address () ? a.get_ip_address () : " None" );
41
42
42
43
// Open a socket on the network interface, and create a TCP connection to ifconfig.io
43
44
TCPSocket socket;
You can’t perform that action at this time.
0 commit comments