A socket to be attached to a liquid storing container having an opening formed in an upper surface thereof, the opening being formed with a cylindrical shape about a first axial line, the socket characterized by: a socket body including, formed therein, a socket liquid outflow passage that causes a liquid drawn out from a plug fixed to the opening to flow to an outside; a socket liquid inflow passage that guides the liquid flowing in from the outside of the liquid storing container to the plug; and a socket gas passage that circulates an outside air between an inside space of the liquid storing container and an outside space of the liquid storing container, the socket body having a columnar insert hole formed along a second axial line so as to penetrate through the socket liquid outflow passage and the socket liquid inflow passage, the second axial line intersecting with the first axial line; a columnar rotary valve having an outflow through-hole and an inflow through-hole and inserted into the insert hole, the outflow through-hole being formed at a location where the socket liquid outflow passage is disposed on the second axial line, the inflow through-hole being formed at a location where the socket liquid inflow passage is disposed on the second axial line; and a switching mechanism that switches between an open state and a closed state when the rotary valve is rotated about the second axial line, the open state being a state in which the outflow through-hole and the socket liquid outflow passage communicate with each other and the inflow through-hole and the socket liquid inflow passage communicate with each other, the closed state being a state in which the outflow through-hole and the socket liquid outflow passage do not communicate with each other and the inflow through-hole and the socket liquid inflow passage do not communicate with each other. a socket body including, formed therein, a socket liquid outflow passage that causes a liquid drawn out from a plug fixed to the opening to flow to an outside; a socket liquid inflow passage that guides the liquid flowing in from the outside of the liquid storing container to the plug; and a socket gas passage that circulates an outside air between an inside space of the liquid storing container and an outside space of the liquid storing container, the socket body having a columnar insert hole formed along a second axial line so as to penetrate through the socket liquid outflow passage and the socket liquid inflow passage, the second axial line intersecting with the first axial line; a columnar rotary valve having an outflow through-hole and an inflow through-hole and inserted into the insert hole, the outflow through-hole being formed at a location where the socket liquid outflow passage is disposed on the second axial line, the inflow through-hole being formed at a location where the socket liquid inflow passage is disposed on the second axial line; and a switching mechanism that switches between an open state and a closed state when the rotary valve is rotated about the second axial line, the open state being a state in which the outflow through-hole and the socket liquid outflow passage communicate with each other and the inflow through-hole and the socket liquid inflow passage communicate with each other, the closed state being a state in which the outflow through-hole and the socket liquid outflow passage do not communicate with each other and the inflow through-hole and the socket liquid inflow passage do not communicate with each other.