getMode reads mode from connection