Start of control socket implementation.