public static IMakeDataTransportPacket CreateDataTransportPacket(TransportDataType type) { switch (type) { case TransportDataType.General: return(new GeneralDataTransportProtocol()); case TransportDataType.BigData: return(new BigDataTransportProtocol()); default: throw new Exception("没有找到匹配的协议"); } }
public TransportData(string data, TransportDataType type) { this.data = data; this.type = type; }