This commit is contained in:
2021-01-11 09:35:33 +01:00
parent bc54fc0211
commit 60a5e03a21
5 changed files with 107 additions and 7 deletions

View File

@@ -7,6 +7,8 @@ Imports System.IO
Public Class Client
Private ReadOnly _logger As Logger
Private ReadOnly _channelFactory As ChannelFactory(Of IEDMIServiceChannel)
Private _ServiceAddress As String
Private _IPAddressServer As String
Private _channel As IEDMIServiceChannel
Public Class StreamedFile
@@ -32,6 +34,7 @@ Public Class Client
_logger = LogConfig.GetLogger()
Try
_ServiceAddress = ServiceAdress
Dim oBinding = Channel.GetBinding()
Dim oAddress = New EndpointAddress(ServiceAdress)
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
@@ -46,6 +49,7 @@ Public Class Client
_logger = LogConfig.GetLogger()
Try
_IPAddressServer = IPAddress
Dim oBinding = Channel.GetBinding()
Dim oAddress = New EndpointAddress($"net.tcp://{IPAddress}:{PortNumber}/DigitalData/Services/Main")
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
@@ -67,7 +71,8 @@ Public Class Client
_logger.Debug("Opening channel..")
_channel.Open()
_logger.Info("Connection to Service established!")
_logger.Info($"Connection to AppService {_IPAddressServer} successfully established!")
Return True
Catch ex As Exception
_logger.Error(ex)
@@ -255,7 +260,7 @@ Public Class Client
''' <returns>A channel object</returns>
Private Function GetChannel() As IEDMIServiceChannel
Try
_logger.Debug("Creating channel..")
_logger.Debug("...Creating channel..")
Dim oChannel = _channelFactory.CreateChannel()
AddHandler oChannel.Faulted, AddressOf Reconnect