From 0b7c83626a0300270fa065c53fe07eaea1da766a Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 30 Sep 2021 13:17:44 +0200 Subject: [PATCH] EDMI.API: Better parsing of Service address --- Modules.EDMIAPI/Client.vb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Modules.EDMIAPI/Client.vb b/Modules.EDMIAPI/Client.vb index 5bee249f..06d1b313 100644 --- a/Modules.EDMIAPI/Client.vb +++ b/Modules.EDMIAPI/Client.vb @@ -44,13 +44,22 @@ Public Class Client ''' Creates a new EDMI Client object ''' ''' LogConfig object - ''' The full service url to connect to, for example: net.tcp://1.1.1.1:1111/some/path + ''' The IP address/hostname and port, separated by semicolon or colon, ex localhost:9000 Public Sub New(LogConfig As LogConfig, ServiceAdress As String) _logger = LogConfig.GetLogger() + Dim oServiceAddress As String = ServiceAdress + Dim oAddressArray() As String + + If oServiceAddress.Contains(";") Then + oAddressArray = oServiceAddress.Split(";") + Else + oAddressArray = oServiceAddress.Split(":") + End If + Try Dim oBinding = Channel.GetBinding() - Dim oAddress = New EndpointAddress(ServiceAdress) + Dim oAddress = New EndpointAddress($"net.tcp://{oAddressArray(0)}:{oAddressArray(1)}/DigitalData/Services/Main") Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress) _channelFactory = oFactory