I know this if() clause is to separate real connections from test connections - but since we also support Unix sockets, those will follow a different codepath than tcp connections. Do you think this will have side-effects when using unix sockets?

I'm currently trying the test script provided in #1004 over a unix socket, as a start.