Socket exists before sending the message

if the socket does not exist, it SEGV