createOneFTP static method
Future
createOneFTP(
- PortConfig config
)
Implementation
static Future createOneFTP(PortConfig config) async {
config.uuid = getOneUUID();
final channel = await Channel.getOpenIoTHubChannel();
final stub = CommonDeviceManagerClient(channel);
final response = await stub.createOneFTP(config);
print('Greeter client received: ${response}');
channel.shutdown();
//服务器同步
PortInfo portInfo = PortInfo();
portInfo.uUID = config.uuid;
portInfo.hostUUID = config.device.uuid;
portInfo.name = config.name;
portInfo.description = config.description;
portInfo.bindAllAddr = config.bindAllAddr;
portInfo.domain = config.domain;
portInfo.port = config.remotePort;
portInfo.localPort = config.localProt;
portInfo.networkProtocol = config.networkProtocol;
portInfo.applicationProtocol = config.applicationProtocol;
PortManager.AddPort(portInfo);
}