示例#1
0
 public void Invoke(string operation,
                    Ice.OperationMode mode,
                    Ice.FormatType?format,
                    Dictionary <string, string>?context,
                    bool synchronous,
                    System.Action <Ice.OutputStream>?write)
 {
     Debug.Assert(Os != null);
     try
     {
         Prepare(operation, mode, context);
         if (write != null)
         {
             Os.StartEncapsulation(Encoding, format);
             write(Os);
             Os.EndEncapsulation();
         }
         else
         {
             Os.WriteEmptyEncapsulation(Encoding);
         }
         Invoke(operation, synchronous);
     }
     catch (Ice.Exception ex)
     {
         Abort(ex);
     }
 }
示例#2
0
文件: PluginI.cs 项目: motuii/ice
 public Request(LocatorI locator,
                string operation,
                Ice.OperationMode mode,
                byte[] inParams,
                Dictionary <string, string> context)
 {
     _locator   = locator;
     _operation = operation;
     _mode      = mode;
     _inParams  = inParams;
     _context   = context;
 }
示例#3
0
 public void Invoke(string operation,
                    Ice.OperationMode mode,
                    Ice.FormatType?format,
                    Dictionary <string, string>?context,
                    bool synchronous,
                    System.Action <Ice.OutputStream>?write          = null,
                    System.Action <Ice.UserException>?userException = null,
                    System.Func <Ice.InputStream, T>?read           = null)
 {
     Read          = read;
     UserException = userException;
     base.Invoke(operation, mode, format, context, synchronous, write);
 }
示例#4
0
        public void Prepare(string operation, Ice.OperationMode mode, Dictionary <string, string>?context)
        {
            Debug.Assert(Os != null);
            Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(Proxy.IceReference.GetProtocol()));

            Mode = mode;

            Observer = ObserverHelper.get(Proxy, operation, context);

            switch (Proxy.IceReference.GetMode())
            {
            case Ice.InvocationMode.Twoway:
            case Ice.InvocationMode.Oneway:
            case Ice.InvocationMode.Datagram:
            {
                Os.WriteBlob(Protocol.requestHdr);
                break;
            }

            case Ice.InvocationMode.BatchOneway:
            case Ice.InvocationMode.BatchDatagram:
            {
                Debug.Assert(false);         // not implemented
                break;
            }
            }

            Reference rf = Proxy.IceReference;

            rf.GetIdentity().IceWrite(Os);

            //
            // For compatibility with the old FacetPath.
            //
            string facet = rf.GetFacet();

            if (facet == null || facet.Length == 0)
            {
                Os.WriteStringSeq(System.Array.Empty <string>());
            }
            else
            {
                string[] facetPath = { facet };
                Os.WriteStringSeq(facetPath);
            }

            Os.WriteString(operation);

            Os.WriteByte((byte)mode);

            if (context != null)
            {
                //
                // Explicit context
                //
                Ice.ContextHelper.Write(Os, context);
            }
            else
            {
                //
                // Implicit context
                //
                var implicitContext = (Ice.ImplicitContext?)rf.GetCommunicator().GetImplicitContext();
                Dictionary <string, string> prxContext = rf.GetContext();

                if (implicitContext == null)
                {
                    Ice.ContextHelper.Write(Os, prxContext);
                }
                else
                {
                    implicitContext.Write(prxContext, Os);
                }
            }
        }