Zooflow: Implement Single file Search Results, Rework client wrt Address parsing
This commit is contained in:
31
Modules.EDMIAPI/Client/Connection.vb
Normal file
31
Modules.EDMIAPI/Client/Connection.vb
Normal 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
|
||||
Reference in New Issue
Block a user