[PATCH 4/6] server: Use an enum to store socket connection state.