resolved ip address configuration

conditional compiling
master
謝桂綱 10 years ago
parent 71656a2c02
commit b792af35ba

@ -14,19 +14,12 @@ Namespace TaskHost
Implements IRemoteSupport
Implements IDisposable
''' <summary>
''' Running on local LAN
''' </summary>
Dim _local As Boolean
''' <summary>
'''
''' </summary>
''' <param name="local">Program is running in a local server cluster which in the range of the same LAN network?</param>
''' <param name="port">You can suing function <see cref="GetFirstAvailablePort"/> to initialize this server object.</param>
Sub New(Optional local As Boolean = True, Optional port As Integer = 1234)
Sub New(Optional port As Integer = 1234)
Call MyBase.New(port)
_local = local
__host.Responsehandler = AddressOf New ProtocolHandler(Me).HandleRequest
FileSystem = New FileSystemHost(GetFirstAvailablePort)
End Sub
@ -37,7 +30,7 @@ Namespace TaskHost
Public Overrides ReadOnly Property Portal As IPEndPoint
Get
Return Me.GetPortal(_local)
Return Me.GetPortal
End Get
End Property

@ -35,7 +35,7 @@ Namespace TaskHost
If elType Is Nothing Then
elType = type
End If
Dim linq As New LinqProvider(source, elType, False) ' Linq
Dim linq As New LinqProvider(source, elType) ' Linq
Dim portal As IPEndPoint = linq.Portal
Call __linq.Add(portal.ToString, linq) '
Return portal

@ -21,28 +21,26 @@ Namespace TaskHost
ReadOnly _arrayType As Type
ReadOnly _type As Type
ReadOnly _source As Iterator
ReadOnly _local As Boolean
''' <summary>
'''
''' </summary>
''' <param name="source"></param>
''' <param name="type">Element's <see cref="System.Type">type</see> in the <paramref name="source"/></param>
Sub New(source As IEnumerable, type As Type, Optional local As Boolean = True)
Sub New(source As IEnumerable, type As Type)
Call MyBase.New(Net.GetFirstAvailablePort)
_type = type
_source = New Iterator(source)
_local = local
__host.Responsehandler = AddressOf New ProtocolHandler(Me).HandleRequest
_arrayType = type.MakeArrayType
Call Runtask(AddressOf __host.Run)
Call RunTask(AddressOf __host.Run)
End Sub
Public Overrides ReadOnly Property Portal As IPEndPoint
Get
Return Me.GetPortal(_local)
Return Me.GetPortal
End Get
End Property

@ -10,6 +10,6 @@ Module Program
<ExportAPI("/start", Usage:="/start /port <port, default:1234>")>
Public Function Start(args As CommandLine.CommandLine) As Integer
Dim port As Integer = args.GetValue("/port", 1234)
Return New TaskInvoke(True, port).Run() ' No more code needs on your cloud server, just needs 2 lines code to running your task host.
Return New TaskInvoke(port).Run() ' No more code needs on your cloud server, just needs 2 lines code to running your task host.
End Function
End Module

Loading…
Cancel
Save