|
|
|
|
@ -1,49 +1,49 @@
|
|
|
|
|
#Region "Microsoft.VisualBasic::596f11e06500e4ccde1801ae45c85a3e, Parallel\IpcParallel\IPCSocket.vb"
|
|
|
|
|
|
|
|
|
|
' Author:
|
|
|
|
|
'
|
|
|
|
|
' asuka (amethyst.asuka@gcmodeller.org)
|
|
|
|
|
' xie (genetics@smrucc.org)
|
|
|
|
|
' xieguigang (xie.guigang@live.com)
|
|
|
|
|
'
|
|
|
|
|
' Copyright (c) 2018 GPL3 Licensed
|
|
|
|
|
'
|
|
|
|
|
'
|
|
|
|
|
' GNU GENERAL PUBLIC LICENSE (GPL3)
|
|
|
|
|
'
|
|
|
|
|
'
|
|
|
|
|
' This program is free software: you can redistribute it and/or modify
|
|
|
|
|
' it under the terms of the GNU General Public License as published by
|
|
|
|
|
' the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
' (at your option) any later version.
|
|
|
|
|
'
|
|
|
|
|
' This program is distributed in the hope that it will be useful,
|
|
|
|
|
' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
' GNU General Public License for more details.
|
|
|
|
|
'
|
|
|
|
|
' You should have received a copy of the GNU General Public License
|
|
|
|
|
' along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
' /********************************************************************************/
|
|
|
|
|
|
|
|
|
|
' Summaries:
|
|
|
|
|
|
|
|
|
|
' Class IPCSocket
|
|
|
|
|
'
|
|
|
|
|
' Properties: handleError, handleGetArgument, handlePOSTResult, host, HostPort
|
|
|
|
|
' nargs, Protocol
|
|
|
|
|
'
|
|
|
|
|
' Constructor: (+1 Overloads) Sub New
|
|
|
|
|
'
|
|
|
|
|
' Function: GetArgumentByIndex, GetArgumentNumber, GetFirstAvailablePort, GetTask, PostError
|
|
|
|
|
' PostResult, PostStart, Run
|
|
|
|
|
'
|
|
|
|
|
' Sub: [Stop]
|
|
|
|
|
'
|
|
|
|
|
' /********************************************************************************/
|
|
|
|
|
' Author:
|
|
|
|
|
'
|
|
|
|
|
' asuka (amethyst.asuka@gcmodeller.org)
|
|
|
|
|
' xie (genetics@smrucc.org)
|
|
|
|
|
' xieguigang (xie.guigang@live.com)
|
|
|
|
|
'
|
|
|
|
|
' Copyright (c) 2018 GPL3 Licensed
|
|
|
|
|
'
|
|
|
|
|
'
|
|
|
|
|
' GNU GENERAL PUBLIC LICENSE (GPL3)
|
|
|
|
|
'
|
|
|
|
|
'
|
|
|
|
|
' This program is free software: you can redistribute it and/or modify
|
|
|
|
|
' it under the terms of the GNU General Public License as published by
|
|
|
|
|
' the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
' (at your option) any later version.
|
|
|
|
|
'
|
|
|
|
|
' This program is distributed in the hope that it will be useful,
|
|
|
|
|
' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
' GNU General Public License for more details.
|
|
|
|
|
'
|
|
|
|
|
' You should have received a copy of the GNU General Public License
|
|
|
|
|
' along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
' /********************************************************************************/
|
|
|
|
|
|
|
|
|
|
' Summaries:
|
|
|
|
|
|
|
|
|
|
' Class IPCSocket
|
|
|
|
|
'
|
|
|
|
|
' Properties: handleError, handleGetArgument, handlePOSTResult, host, HostPort
|
|
|
|
|
' nargs, Protocol
|
|
|
|
|
'
|
|
|
|
|
' Constructor: (+1 Overloads) Sub New
|
|
|
|
|
'
|
|
|
|
|
' Function: GetArgumentByIndex, GetArgumentNumber, GetFirstAvailablePort, GetTask, PostError
|
|
|
|
|
' PostResult, PostStart, Run
|
|
|
|
|
'
|
|
|
|
|
' Sub: [Stop]
|
|
|
|
|
'
|
|
|
|
|
' /********************************************************************************/
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
@ -52,6 +52,7 @@ Imports System.Text
|
|
|
|
|
Imports Microsoft.VisualBasic.ComponentModel
|
|
|
|
|
#If netcore5 = 1 Then
|
|
|
|
|
Imports Microsoft.VisualBasic.ComponentModel.Collection
|
|
|
|
|
Imports Microsoft.VisualBasic.Linq
|
|
|
|
|
#End If
|
|
|
|
|
Imports Microsoft.VisualBasic.Net.Protocols.Reflection
|
|
|
|
|
Imports Microsoft.VisualBasic.Net.Tcp
|
|
|
|
|
@ -155,7 +156,7 @@ Public Class IPCSocket : Implements ITaskDriver
|
|
|
|
|
<Protocol(Protocols.PostError)>
|
|
|
|
|
Public Function PostError(request As RequestStream, remoteAddress As System.Net.IPEndPoint) As BufferPipe
|
|
|
|
|
Using ms As New MemoryStream(request.ChunkBuffer)
|
|
|
|
|
Call _handleError(host.streamBuf.handleCreate(ms, GetType(IPCError), StreamMethods.Auto))
|
|
|
|
|
Call DirectCast(SlaveTask.GetValueFromStream(ms, GetType(IPCError), host.streamBuf), IPCError).DoCall(_handleError)
|
|
|
|
|
End Using
|
|
|
|
|
|
|
|
|
|
Return New DataPipe(Encoding.ASCII.GetBytes("OK!"))
|
|
|
|
|
|