Fix assertion to only check for TCP sockets