EDMI.API: Better parsing of Service address
This commit is contained in:
parent
6c9e459bf7
commit
0b7c83626a
@ -44,13 +44,22 @@ Public Class Client
|
||||
''' Creates a new EDMI Client object
|
||||
''' </summary>
|
||||
''' <param name="LogConfig">LogConfig object</param>
|
||||
''' <param name="ServiceAdress">The full service url to connect to, for example: net.tcp://1.1.1.1:1111/some/path</param>
|
||||
''' <param name="ServiceAdress">The IP address/hostname and port, separated by semicolon or colon, ex localhost:9000</param>
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user