ServerProcessing Enum
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menunjukkan status pemrosesan pesan server.
public enum class ServerProcessing
[System.Serializable]
public enum ServerProcessing
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum ServerProcessing
[<System.Serializable>]
type ServerProcessing =
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ServerProcessing =
Public Enum ServerProcessing
- Warisan
- Atribut
Bidang
Async | 2 | Panggilan dikirim secara asinkron, yang menunjukkan bahwa sink harus menyimpan data respons pada tumpukan untuk diproses nanti. |
Complete | 0 | Server secara sinkron memproses pesan. |
OneWay | 1 | Pesan dikirim dan tidak ada respons yang dapat dikirim. |
Contoh
public ServerProcessing ProcessMessage(IServerChannelSinkStack myServerChannelSinkStack,
IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream,
out IMessage msg, out ITransportHeaders responseHeaders,
out Stream responseStream)
{
if (myBoolEnabled)
LoggingHelper.PrintRequest(myTextWriterOutput, requestHeaders, ref requestStream);
myServerChannelSinkStack.Push(this, null);
ServerProcessing myServerProcessing =
myNewNextSink.ProcessMessage(myServerChannelSinkStack, requestMsg, requestHeaders, requestStream, out msg,
out responseHeaders, out responseStream);
Console.WriteLine("ServerProcessing.Complete value is: " +ServerProcessing.Complete);
Console.WriteLine("ServerProcessing.OneWay Value is: " +ServerProcessing.OneWay);
Console.WriteLine("ServerProcessing.Async value is: " +ServerProcessing.Async);
switch (myServerProcessing)
{
case ServerProcessing.Complete:
{
myServerChannelSinkStack.Pop(this);
if (myBoolEnabled)
LoggingHelper.PrintResponse(myTextWriterOutput, responseHeaders, ref responseStream);
break;
}
case ServerProcessing.OneWay:
{
myServerChannelSinkStack.Pop(this);
break;
}
case ServerProcessing.Async:
{
myServerChannelSinkStack.Store(this, null);
break;
}
}
return myServerProcessing;
}
Public Function ProcessMessage(ByVal myServerChannelSinkStack As IServerChannelSinkStack, _
ByVal requestMsg As IMessage, ByVal requestHeaders As ITransportHeaders, ByVal requestStream As Stream, ByRef _
msg As IMessage, ByRef responseHeaders As ITransportHeaders, ByRef responseStream _
As Stream) As ServerProcessing Implements IServerChannelSink.ProcessMessage
If myBoolEnabled Then
LoggingHelper.PrintRequest(myTextWriterOutput, requestHeaders, requestStream)
End If
myServerChannelSinkStack.Push(Me, Nothing)
Dim myServerProcessing As ServerProcessing = myNewNextSink.ProcessMessage( _
myServerChannelSinkStack, requestMsg, requestHeaders, requestStream, msg, responseHeaders, responseStream)
Console.WriteLine("ServerProcessing.Complete value is: " + ServerProcessing.Complete.Tostring())
Console.WriteLine("ServerProcessing.OneWay Value is: " + ServerProcessing.OneWay.Tostring())
Console.WriteLine("ServerProcessing.Async value is: " + ServerProcessing.Async.Tostring())
Select Case myServerProcessing
Case ServerProcessing.Complete
myServerChannelSinkStack.Pop(Me)
If myBoolEnabled Then
LoggingHelper.PrintResponse(myTextWriterOutput, responseHeaders, responseStream)
End If
Case ServerProcessing.OneWay
myServerChannelSinkStack.Pop(Me)
Case ServerProcessing.Async
myServerChannelSinkStack.Store(Me, Nothing)
End Select
Return myServerProcessing
End Function 'ProcessMessage
Berlaku untuk
Berkolaborasi dengan kami di GitHub
Sumber untuk konten ini dapat ditemukan di GitHub, yang juga dapat Anda gunakan untuk membuat dan meninjau masalah dan menarik permintaan. Untuk informasi selengkapnya, lihat panduan kontributor kami.