IClientChannelSink.AsyncProcessRequest 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
현재 싱크에서 메서드 호출을 비동기식으로 처리하도록 요청합니다.
public:
void AsyncProcessRequest(System::Runtime::Remoting::Channels::IClientChannelSinkStack ^ sinkStack, System::Runtime::Remoting::Messaging::IMessage ^ msg, System::Runtime::Remoting::Channels::ITransportHeaders ^ headers, System::IO::Stream ^ stream);
public void AsyncProcessRequest (System.Runtime.Remoting.Channels.IClientChannelSinkStack sinkStack, System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Channels.ITransportHeaders headers, System.IO.Stream stream);
[System.Security.SecurityCritical]
public void AsyncProcessRequest (System.Runtime.Remoting.Channels.IClientChannelSinkStack sinkStack, System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Channels.ITransportHeaders headers, System.IO.Stream stream);
abstract member AsyncProcessRequest : System.Runtime.Remoting.Channels.IClientChannelSinkStack * System.Runtime.Remoting.Messaging.IMessage * System.Runtime.Remoting.Channels.ITransportHeaders * System.IO.Stream -> unit
[<System.Security.SecurityCritical>]
abstract member AsyncProcessRequest : System.Runtime.Remoting.Channels.IClientChannelSinkStack * System.Runtime.Remoting.Messaging.IMessage * System.Runtime.Remoting.Channels.ITransportHeaders * System.IO.Stream -> unit
Public Sub AsyncProcessRequest (sinkStack As IClientChannelSinkStack, msg As IMessage, headers As ITransportHeaders, stream As Stream)
매개 변수
- sinkStack
- IClientChannelSinkStack
이 싱크를 호출한 채널 싱크의 스택입니다.
- msg
- IMessage
처리할 메시지입니다.
- headers
- ITransportHeaders
서버로 보내는 메시지 머리글에 추가할 헤더입니다.
- stream
- Stream
전송 싱크로 향하는 스트림입니다.
- 특성
예외
직접 실행 호출자에 인프라 권한이 없는 경우
예제
[SecurityPermission(SecurityAction::Demand, Flags = SecurityPermissionFlag::Infrastructure)]
private ref class MyClientFormatterChannelSink: public BaseChannelSinkWithProperties, public IClientChannelSink, public IMessageSink
{
private:
IClientChannelSink^ nextClientSink;
IMessageSink^ nextMessageSink;
public:
MyClientFormatterChannelSink()
: nextClientSink( nullptr ), nextMessageSink( nullptr )
{}
MyClientFormatterChannelSink( IClientChannelSink^ nextSink, IMessageSink^ nextMsgSink )
: BaseChannelSinkWithProperties()
{
nextClientSink = nextSink;
nextMessageSink = nextMsgSink;
}
virtual void ProcessMessage( IMessage^ message, ITransportHeaders^ requestHeaders, Stream^ requestStream, [Out]ITransportHeaders^% responseHeaders, [Out]Stream^% responseStream )
{
nextClientSink->ProcessMessage( message, requestHeaders, requestStream, responseHeaders, responseStream );
}
virtual void AsyncProcessRequest( IClientChannelSinkStack^ sinkStack, IMessage^ msg, ITransportHeaders^ headers, Stream^ myStream )
{
sinkStack->Push( this, nullptr );
nextClientSink->AsyncProcessRequest( sinkStack, msg, headers, myStream );
}
virtual void AsyncProcessResponse( IClientResponseChannelSinkStack^ sinkStack, Object^ /*state*/, ITransportHeaders^ headers, Stream^ myStream )
{
sinkStack->AsyncProcessResponse( headers, myStream );
}
virtual Stream^ GetRequestStream( IMessage^ /*msg*/, ITransportHeaders^ /*headers*/ )
{
return nullptr;
}
property IClientChannelSink^ NextChannelSink
{
virtual IClientChannelSink^ get()
{
return nextClientSink;
}
}
property IMessageSink^ NextSink
{
virtual IMessageSink^ get()
{
return nextMessageSink;
}
}
virtual IMessageCtrl^ AsyncProcessMessage( IMessage^ /*msg*/, IMessageSink^ /*replySink*/ )
{
return nullptr;
}
virtual IMessage^ SyncProcessMessage( IMessage^ msg )
{
return nextMessageSink->SyncProcessMessage( msg );
}
property Object^ Item [Object^]
{
virtual Object^ get( Object^ key ) override
{
if ( key == MyKey::typeid )
return this;
return nullptr;
}
virtual void set( Object^ /*value*/, Object^ /*key*/ ) override
{
throw gcnew NotSupportedException;
}
}
property ICollection^ Keys
{
virtual ICollection^ get() override
{
ArrayList^ myKeys = gcnew ArrayList( 1 );
myKeys->Add( MyKey::typeid );
return myKeys;
}
}
};
internal class MyClientFormatterChannelSink :
BaseChannelSinkWithProperties, IClientChannelSink, IMessageSink
{
private IClientChannelSink nextClientSink=null;
private IMessageSink nextMessageSink = null;
public MyClientFormatterChannelSink(IClientChannelSink nextSink,
IMessageSink nextMsgSink) : base()
{
nextClientSink = nextSink;
nextMessageSink = nextMsgSink;
}
public void ProcessMessage(IMessage msg,
ITransportHeaders requestHeaders, Stream requestStream,
out ITransportHeaders responseHeaders, out Stream responseStream)
{
nextClientSink.ProcessMessage(msg, requestHeaders, requestStream,
out responseHeaders, out responseStream);
}
public void AsyncProcessRequest(IClientChannelSinkStack sinkStack,
IMessage msg, ITransportHeaders headers, Stream myStream)
{
sinkStack.Push(this, null);
nextClientSink.AsyncProcessRequest(sinkStack,msg,headers,myStream);
}
public void AsyncProcessResponse(IClientResponseChannelSinkStack sinkStack,
Object state, ITransportHeaders headers, Stream myStream)
{
sinkStack.AsyncProcessResponse(headers, myStream);
}
public Stream GetRequestStream(IMessage msg,ITransportHeaders headers)
{
return null;
}
public IClientChannelSink NextChannelSink
{
get
{
return nextClientSink;
}
}
public IMessageSink NextSink
{
get
{
return nextMessageSink;
}
}
public IMessageCtrl AsyncProcessMessage(IMessage msg,
IMessageSink replySink)
{
return null;
}
public IMessage SyncProcessMessage(IMessage msg)
{
return nextMessageSink.SyncProcessMessage(msg);
}
public override Object this[Object key]
{
get
{
if (key == typeof(MyKey))
return this;
return null;
}
set
{
throw new NotSupportedException();
}
}
public override ICollection Keys
{
get
{
ArrayList myKeys = new ArrayList(1);
myKeys.Add(typeof(MyKey));
return myKeys;
}
}
}
public class MyKey
{
}
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")> _
Friend Class MyClientFormatterChannelSink
Inherits BaseChannelSinkWithProperties
Implements IClientChannelSink, IMessageSink
Private nextClientSink As IClientChannelSink = Nothing
Private nextMessageSink As IMessageSink = Nothing
Public Sub New(nextSink As IClientChannelSink, nextMsgSink As IMessageSink)
MyBase.New()
nextClientSink = nextSink
nextMessageSink = nextMsgSink
End Sub
Public Sub ProcessMessage(msg As IMessage, requestHeaders As ITransportHeaders, _
requestStream As Stream, ByRef responseHeaders As ITransportHeaders, _
ByRef responseStream As Stream) _
Implements IClientChannelSink.ProcessMessage
nextClientSink.ProcessMessage(msg, requestHeaders, requestStream, _
responseHeaders, responseStream)
End Sub
Public Sub AsyncProcessRequest(sinkStack As IClientChannelSinkStack, _
msg As IMessage, headers As ITransportHeaders, myStream As Stream) _
Implements IClientChannelSink.AsyncProcessRequest
sinkStack.Push(Me, Nothing)
nextClientSink.AsyncProcessRequest(sinkStack, msg, headers, myStream)
End Sub
Public Sub AsyncProcessResponse(sinkStack As IClientResponseChannelSinkStack, _
state As Object, headers As ITransportHeaders, myStream As Stream) _
Implements IClientChannelSink.AsyncProcessResponse
sinkStack.AsyncProcessResponse(headers, myStream)
End Sub
Public Function GetRequestStream(msg As IMessage, headers As ITransportHeaders) As Stream _
Implements IClientChannelSink.GetRequestStream
Return Nothing
End Function 'GetRequestStream
Public ReadOnly Property NextChannelSink() As IClientChannelSink _
Implements IClientChannelSink.NextChannelSink
Get
Return nextClientSink
End Get
End Property
Public ReadOnly Property NextSink() As IMessageSink _
Implements IMessageSink.NextSink
Get
Return nextMessageSink
End Get
End Property
Public Overrides ReadOnly Property Properties() As Collections.IDictionary _
Implements IClientChannelSink.Properties
Get
End Get
End Property
Public Function AsyncProcessMessage(msg As IMessage, replySink As IMessageSink) As IMessageCtrl _
Implements IMessageSink.AsyncProcessMessage
Return Nothing
End Function 'AsyncProcessMessage
Public Function SyncProcessMessage(msg As IMessage) As IMessage _
Implements IMessageSink.SyncProcessMessage
Return nextMessageSink.SyncProcessMessage(msg)
End Function 'SyncProcessMessage
Default Public Overrides Property Item(key As Object) As Object
Get
If key Is GetType(MyKey) Then
Return Me
End If
Return Nothing
End Get
Set
Throw New NotSupportedException()
End Set
End Property
Public Overrides ReadOnly Property Keys() As ICollection
Get
Dim myKeys As New ArrayList(0)
myKeys.Add(GetType(MyKey))
Return myKeys
End Get
End Property
End Class
Public Class MyKey
End Class
적용 대상
추가 정보
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET