error connecting device to IoT Edge gateway

While connecting to edge gateway from simulated device code, facing connection timeout with below exceptions:

'Microsoft.Azure.Devices.Client.Exceptions.IotHubClientException' in Microsoft.Azure.Devices.Client.dll
    Exception thrown: 'Microsoft.Azure.Devices.Client.Exceptions.IotHubClientException' in mscorlib.dll
    Exception thrown: 'System.AggregateException' in Microsoft.Azure.Devices.Client.dll
    Exception thrown: 'System.AggregateException' in mscorlib.dll
'Microsoft.Azure.Devices.Client.Exceptions.IotHubClientException' in Microsoft.Azure.Devices.Client.dll
    Exception thrown: 'Microsoft.Azure.Devices.Client.Exceptions.IotHubClientException' in mscorlib.dll
    Exception thrown: 'Microsoft.Azure.Devices.Client.Exceptions.IotHubClientTransientException' in Microsoft.Azure.Devices.Client.dll
    Exception thrown: 'Microsoft.Azure.Devices.Client.Exceptions.IotHubClientTransientException' in mscorlib.dll
    Exception thrown: 'Microsoft.Azure.Devices.Client.Exceptions.IotHubClientTransientException' in Microsoft.Azure.Devices.Client.dll

I am adding ConnectionString in correct format & also included the GatewayHostName configured from https://docs.microsoft.com/en-us/azure/iot-edge/how-to-create-transparent-gateway