internal static int ReadRegionTableResponse(Socket socket, out RegionTable table) { using (KVMemoryStream stream = ReadResponse(socket)) { int len = stream.ReadInt(); int type = stream.ReadInt(); int retCode = stream.ReadInt(); if (retCode == ProtocolCode.Success) { table = DecoderUtil.decodeRegionTable(stream); } else { table = null; } return(retCode); } }
internal static int ReadStatResponse(Socket socket, out DataServerStruct[] dataServers) { using (KVMemoryStream stream = ReadResponse(socket)) { int len = stream.ReadInt(); int type = stream.ReadInt(); int retCode = stream.ReadInt(); dataServers = null; int size = stream.ReadInt(); if (size > 0) { dataServers = new DataServerStruct[size]; for (int i = 0; i < size; i++) { dataServers[i] = DecoderUtil.decodeDataServer(stream); } } return(retCode); } }