Added error printing for BSD sockets