I try to connect to my UNIX-socket server using openbsd-netcat, but have an error:
connect(): Protocol wrong type for socket
My socket type is SOCK_SEQPACKET, and it seems that nc tries to open it as SOCK_DGRAM or SOCK_STREAM. BTW, nc can't connect to anonymous UNIX-sockets (which name started with '\0').
So I wonder is there any ways to get socket type information from server to change arguments of socket() for successful connection? Or there's only one way: to look over all types while socket() will succeed?
Let me explain: what is the right thing to do in a situation where the client doesn't know the type of socket to which he needs to connect?
sockstatcyberciti.biz/tips/… I would assume this could let you discover the socket type.