Proper handling of PUBSUB topology - fixed resolving server and client
type of the socket.