ReturnMessage 클래스

정의

원격 개체에서 메서드 호출에 대한 응답으로 반환되는 메시지를 보유합니다.

public ref class ReturnMessage : System::Runtime::Remoting::Messaging::IMethodReturnMessage
public class ReturnMessage : System.Runtime.Remoting.Messaging.IMethodReturnMessage
[System.Runtime.InteropServices.ComVisible(true)]
public class ReturnMessage : System.Runtime.Remoting.Messaging.IMethodReturnMessage
[System.Runtime.InteropServices.ComVisible(true)]
[System.Security.SecurityCritical]
public class ReturnMessage : System.Runtime.Remoting.Messaging.IMethodReturnMessage
type ReturnMessage = class
    interface IMethodReturnMessage
    interface IMethodMessage
    interface IMessage
[<System.Runtime.InteropServices.ComVisible(true)>]
type ReturnMessage = class
    interface IMethodReturnMessage
    interface IMethodMessage
    interface IMessage
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Security.SecurityCritical>]
type ReturnMessage = class
    interface IMethodReturnMessage
    interface IMethodMessage
    interface IMessage
Public Class ReturnMessage
Implements IMethodReturnMessage
상속
ReturnMessage
특성
구현

예제

[System::Security::Permissions::SecurityPermissionAttribute
(System::Security::Permissions::SecurityAction::LinkDemand, 
Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
[System::Security::Permissions::SecurityPermissionAttribute
(System::Security::Permissions::SecurityAction::InheritanceDemand, 
Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
public ref class MyProxy: public RealProxy
{
private:
   String^ stringUri;
   MarshalByRefObject^ myMarshalByRefObject;

public:
   MyProxy( Type^ myType ) : RealProxy( myType )
   {
      myMarshalByRefObject = dynamic_cast<MarshalByRefObject^>(Activator::CreateInstance( myType ));
      ObjRef^ myObject = RemotingServices::Marshal( myMarshalByRefObject );
      stringUri = myObject->URI;
   }

   virtual IMessage^ Invoke( IMessage^ myMessage ) override
   {
      IMethodCallMessage^ myCallMessage = (IMethodCallMessage^)( myMessage );

      IMethodReturnMessage^ myIMethodReturnMessage =
         RemotingServices::ExecuteMessage( myMarshalByRefObject, myCallMessage );

      Console::WriteLine( "Method name : {0}", myIMethodReturnMessage->MethodName );
      Console::WriteLine( "The return value is : {0}", myIMethodReturnMessage->ReturnValue );

      // Get number of 'ref' and 'out' parameters.
      int myArgOutCount = myIMethodReturnMessage->OutArgCount;
      Console::WriteLine( "The number of 'ref', 'out' parameters are : {0}",
         myIMethodReturnMessage->OutArgCount );
      // Gets name and values of 'ref' and 'out' parameters.
      for ( int i = 0; i < myArgOutCount; i++ )
      {
         Console::WriteLine( "Name of argument {0} is '{1}'.",
            i, myIMethodReturnMessage->GetOutArgName( i ) );
         Console::WriteLine( "Value of argument {0} is '{1}'.",
            i, myIMethodReturnMessage->GetOutArg( i ) );
      }
      Console::WriteLine();
      array<Object^>^myObjectArray = myIMethodReturnMessage->OutArgs;
      for ( int i = 0; i < myObjectArray->Length; i++ )
         Console::WriteLine( "Value of argument {0} is '{1}' in OutArgs",
            i, myObjectArray[ i ] );
      return myIMethodReturnMessage;
   }
};
public class MyProxy : RealProxy
{
   String stringUri;
   MarshalByRefObject myMarshalByRefObject;

   public MyProxy(Type myType): base(myType)
   {
      myMarshalByRefObject = (MarshalByRefObject)Activator.CreateInstance(myType);
      ObjRef myObject = RemotingServices.Marshal(myMarshalByRefObject);
      stringUri = myObject.URI;
   }

   public override IMessage Invoke(IMessage myMessage)
   {
      IMethodCallMessage myCallMessage = (IMethodCallMessage)myMessage;

      IMethodReturnMessage myIMethodReturnMessage =
         RemotingServices.ExecuteMessage(myMarshalByRefObject, myCallMessage);

      Console.WriteLine("Method name : " + myIMethodReturnMessage.MethodName);
      Console.WriteLine("The return value is : " + myIMethodReturnMessage.ReturnValue);

      // Get number of 'ref' and 'out' parameters.
      int myArgOutCount = myIMethodReturnMessage.OutArgCount;
      Console.WriteLine("The number of 'ref', 'out' parameters are : " +
         myIMethodReturnMessage.OutArgCount);
      // Gets name and values of 'ref' and 'out' parameters.
      for(int i = 0; i < myArgOutCount; i++)
      {
         Console.WriteLine("Name of argument {0} is '{1}'.",
            i, myIMethodReturnMessage.GetOutArgName(i));
         Console.WriteLine("Value of argument {0} is '{1}'.",
            i, myIMethodReturnMessage.GetOutArg(i));
      }
      Console.WriteLine();
      object[] myObjectArray = myIMethodReturnMessage.OutArgs;
      for(int i = 0; i < myObjectArray.Length; i++)
         Console.WriteLine("Value of argument {0} is '{1}' in OutArgs",
            i, myObjectArray[i]);
      return myIMethodReturnMessage;
   }
}
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")> _
Public Class MyProxy
   Inherits RealProxy
   Private stringUri As String
   Private myMarshalByRefObject As MarshalByRefObject
   
   Public Sub New(myType As Type)
      MyBase.New(myType)
      myMarshalByRefObject = CType(Activator.CreateInstance(myType), MarshalByRefObject)
      Dim myObject As ObjRef = RemotingServices.Marshal(myMarshalByRefObject)
      stringUri = myObject.URI
   End Sub
   
   Public Overrides Function Invoke(myMessage As IMessage) As IMessage
      Dim myCallMessage As IMethodCallMessage = CType(myMessage, IMethodCallMessage)

      Dim myIMethodReturnMessage As IMethodReturnMessage = RemotingServices. _
         ExecuteMessage(myMarshalByRefObject, myCallMessage)

      Console.WriteLine("Method name : " + myIMethodReturnMessage.MethodName)
      Console.WriteLine("The return value is : " + myIMethodReturnMessage.ReturnValue)
      
      ' Get number of 'ref' and 'out' parameters.
      Dim myArgOutCount As Integer = myIMethodReturnMessage.OutArgCount
      Console.WriteLine("The number of 'ref', 'out' parameters are : " + _
         myIMethodReturnMessage.OutArgCount.ToString())
      ' Gets name and values of 'ref' and 'out' parameters.
      Dim i As Integer
      For i = 0 To myArgOutCount - 1
         Console.WriteLine("Name of argument {0} is '{1}'.", i, _
            myIMethodReturnMessage.GetOutArgName(i))
         Console.WriteLine("Value of argument {0} is '{1}'.", i, _
            myIMethodReturnMessage.GetOutArg(i))
      Next i
      Console.WriteLine()
      Dim myObjectArray As Object() = myIMethodReturnMessage.OutArgs
      For i = 0 To myObjectArray.Length - 1
         Console.WriteLine("Value of argument {0} is '{1}' in OutArgs", i, myObjectArray(i))
      Next i
      Return myIMethodReturnMessage
   End Function 'Invoke
End Class

설명

참고

이 클래스는 클래스 수준에서 상속 요청과 링크 요청을 만듭니다. SecurityException 직접 실행 호출자 또는 파생된 클래스 중 하나에 인프라 권한이 없는 경우 throw 됩니다. 보안 요청에 대 한 자세한 내용은 참조 하세요 링크 요청 하 고 상속 요청합니다.

생성자

ReturnMessage(Exception, IMethodCallMessage)

ReturnMessage 클래스의 새 인스턴스를 초기화합니다.

ReturnMessage(Object, Object[], Int32, LogicalCallContext, IMethodCallMessage)

메서드 호출 이후에 호출자에게 반환되는 모든 정보를 사용하여 ReturnMessage 클래스의 새 인스턴스를 초기화합니다.

속성

ArgCount

호출된 메서드의 인수 개수를 가져옵니다.

Args

원격 개체에서 호출된 메서드에 전달되는 지정된 인수를 가져옵니다.

Exception

원격 메서드 호출을 수행하는 동안 throw되는 예외를 가져옵니다.

HasVarArgs

호출된 메서드가 여러 개의 인수를 수락하는지 나타내는 값을 가져옵니다.

LogicalCallContext

호출된 메서드의 LogicalCallContext를 가져옵니다.

MethodBase

호출된 메서드의 MethodBase를 가져옵니다.

MethodName

호출된 메서드의 이름을 가져옵니다.

MethodSignature

메서드 시그니처가 들어 있는 Type 개체의 배열을 가져옵니다.

OutArgCount

호출된 메서드에 있는 out 또는 ref 인수의 개수를 가져옵니다.

OutArgs

호출된 메서드에 out 또는 ref 매개 변수로 전달되는 지정된 개체를 가져옵니다.

Properties

현재 IDictionary에 포함된 속성의 ReturnMessage를 가져옵니다.

ReturnValue

호출된 메서드가 반환하는 개체를 가져옵니다.

TypeName

원격 메서드가 호출된 형식의 이름을 가져옵니다.

Uri

원격 메서드가 호출된 원격 개체의 URI를 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetArg(Int32)

메서드를 호출하는 동안 원격 메서드에 전달되는 지정된 인수를 반환합니다.

GetArgName(Int32)

지정된 메서드 인수의 이름을 반환합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetOutArg(Int32)

원격 메서드를 호출하는 동안 out 또는 ref 매개 변수로 전달되는 개체를 반환합니다.

GetOutArgName(Int32)

원격 메서드에 전달되는 지정된 out 또는 ref 매개 변수의 이름을 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상