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
|
''' Creates a new EDMI Client object
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="LogConfig">LogConfig object</param>
|
''' <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)
|
Public Sub New(LogConfig As LogConfig, ServiceAdress As String)
|
||||||
_logger = LogConfig.GetLogger()
|
_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
|
Try
|
||||||
Dim oBinding = Channel.GetBinding()
|
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)
|
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
|
||||||
|
|
||||||
_channelFactory = oFactory
|
_channelFactory = oFactory
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user