fin the the connack pack write's method