inet-socket

How can I map a local unix socket to an inet socket?

I'm curious if it is possible to map a UNIX socket on to an INET socket. The situation is simply that I'd like to connect to a MySQL server. Unfortunately it has INET sockets disabled and therefore I can only connect with UNIX sockets. The tools I'm using/writing have to connect on an INET socket, so I'm trying to see if I can map one on...

BSD Socket issue: inet_ntop returning "0.0.0.0"

I'm trying to get the IP of the machine a socket I've bound is listening on. The port number printed works fine, but the address is "0.0.0.0". Here's the relevant code. res has been passed to getaddrinfo and getsockname before getting to this code. char ip[INET_ADDRSTRLEN]; struct sockaddr_in *ipv4 = (struct sockaddr_in *)res->ai_addr; ...