public UserWorker(ClusterNodeContext context, Config config)
{
_context = context;
_channelType = (ChannelType)Enum.Parse(typeof(ChannelType), config.GetString("type", "Tcp"), true);
_listenEndPoint = new IPEndPoint(IPAddress.Any, config.GetInt("port", 0));
var connectAddress = config.GetString("connect-address");
var connectPort = config.GetInt("connect-port", _listenEndPoint.Port);
_connectEndPoint = new IPEndPoint(connectAddress != null ? IPAddress.Parse(connectAddress) : IPAddress.Loopback, connectPort);
}