Zooflow: Implement Single file Search Results, Rework client wrt Address parsing

This commit is contained in:
Jonathan Jenne
2022-04-13 15:39:01 +02:00
parent 7716a04452
commit 160040535d
23 changed files with 346 additions and 234 deletions

View File

@@ -0,0 +1,31 @@
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Public Class Connection
Public Function ParseServiceAddress(pHost As String, pPort As Integer) As ServerAddressStruct
Dim oAddress As ServerAddressStruct
oAddress.Host = pHost
oAddress.Port = pPort
Return oAddress
End Function
Public Function ParseServiceAddress(pAddress As String) As ServerAddressStruct
Dim oAddressList As List(Of String)
Dim oAddress As ServerAddressStruct
If pAddress.Contains(";"c) Then
oAddressList = pAddress.Split(";"c).ToList
ElseIf pAddress.Contains(":"c) Then
oAddressList = pAddress.Split(":"c).ToList
Else
oAddressList = New List(Of String) From {pAddress, Constants.DEFAULT_SERVICE_PORT}
End If
oAddress.Host = oAddressList.First()
oAddress.Port = oAddressList.Item(1)
Return oAddress
End Function
End Class