accepted_socket->type() should return the right thing. it's currently protected but there's no good reason not to expose it as public.