if (this.transportClient.getTransportClientState() == TransportClient.TransportClientState.OPENED) if (this.transportClient.getTransportClientState() == TransportClient.TransportClientState.OPENED) if (this.transportClient.getTransportClientState() == TransportClient.TransportClientState.OPENED)
if (this.transportClient.getTransportClientState() == TransportClient.TransportClientState.OPENED)
/** * Starts asynchronously sending and receiving messages from an IoT Hub. If * the client is already open, the function shall do nothing. * * @throws IOException if a connection to an IoT Hub cannot be established. */ public void open() throws IOException { if (this.ioTHubConnectionType == IoTHubConnectionType.USE_TRANSPORTCLIENT) { if (this.transportClient.getTransportClientState() == TransportClient.TransportClientState.CLOSED) { // Codes_SRS_DEVICECLIENT_12_007: [If the client has been initialized to use TransportClient and the TransportClient is not opened yet the function shall throw an IOException.] throw new IOException("Calling open() when using the TransportClient is not supported. Use TransportClient.open() instead."); } else { // Codes_SRS_DEVICECLIENT_12_019: [If the client has been initialized to use TransportClient and the TransportClient is already opened the function shall do nothing.] logger.LogInfo("Connection already opened by TransportClient."); } } else { // Codes_SRS_DEVICECLIENT_21_006: [The open shall invoke super.open().] super.open(); } logger.LogInfo("Connection opened with success, method name is %s ", logger.getMethodName()); }
if (this.transportClient.getTransportClientState() == TransportClient.TransportClientState.OPENED)