コード例 #1
0
 /// <summary>Creates an <see cref="OutgoingResponseFrame"/> for operation ice_ids.</summary>
 /// <param name="current">Holds decoded header data and other information about the current request.</param>
 /// <param name="returnValue">The return value to write into the new frame.</param>
 /// <returns>A new <see cref="OutgoingResponseFrame"/>.</returns>
 public static OutgoingResponseFrame IceIds(Current current, IEnumerable <string> returnValue) =>
 OutgoingResponseFrame.WithReturnValue(
     current,
     compress: false,
     format: default,
     returnValue,
     (ostr, returnValue) => ostr.WriteSequence(returnValue, OutputStream.IceWriterFromString));
コード例 #2
0
 /// <summary>Creates an <see cref="OutgoingResponseFrame"/> for operation ice_isA.</summary>
 /// <param name="current">Holds decoded header data and other information about the current request.</param>
 /// <param name="returnValue">The return value to write into the new frame.</param>
 /// <returns>A new <see cref="OutgoingResponseFrame"/>.</returns>
 public static OutgoingResponseFrame IceIsA(Current current, bool returnValue) =>
 OutgoingResponseFrame.WithReturnValue(
     current,
     compress: false,
     format: default,
     returnValue,
     OutputStream.IceWriterFromBool);
コード例 #3
0
 public ValueTask <OutgoingResponseFrame> DispatchAsync(IncomingRequestFrame request, Current current)
 {
     var ae            = new AlsoEmpty();
     var responseFrame =
         OutgoingResponseFrame.WithReturnValue(current,
                                               compress: false,
                                               format: default,
コード例 #4
0
        public ValueTask <OutgoingResponseFrame> DispatchAsync(IncomingRequestFrame request, Current current)
        {
            var ae            = new Test.AlsoEmpty();
            var responseFrame = OutgoingResponseFrame.WithReturnValue(current, format: null,
                                                                      ae, (OutputStream ostr, Test.AlsoEmpty ae) => ostr.WriteClass(ae));

            return(new ValueTask <OutgoingResponseFrame>(responseFrame));
        }
コード例 #5
0
ファイル: BlobjectI.cs プロジェクト: keno1213/ice
 public ValueTask <OutgoingResponseFrame> DispatchAsync(IncomingRequestFrame request, Current current)
 {
     if (current.Operation.Equals("opOneway"))
     {
         if (!current.IsOneway)
         {
             // If called two-way, return exception to caller.
             throw new MyException();
         }
         return(new ValueTask <OutgoingResponseFrame>(OutgoingResponseFrame.WithVoidReturnValue(current)));
     }
     else if (current.Operation.Equals("opString"))
     {
         string s             = request.ReadArgs(current.Communicator, InputStream.IceReaderIntoString);
         var    responseFrame = OutgoingResponseFrame.WithReturnValue(current,
                                                                      compress: false,
                                                                      format: default,
コード例 #6
0
 public async ValueTask <OutgoingResponseFrame> DispatchAsync(Ice.InputStream istr, Current current)
 {
     if (current.Operation.Equals("opOneway"))
     {
         if (!current.IsOneway)
         {
             // If called two-way, return exception to caller.
             throw new Test.MyException();
         }
         return(OutgoingResponseFrame.WithVoidReturnValue(current));
     }
     else if (current.Operation.Equals("opString"))
     {
         string s             = istr.ReadString();
         var    responseFrame = OutgoingResponseFrame.WithReturnValue(current, format: null,
                                                                      (s, s), (OutputStream ostr, (string ReturnValue, string s2)value) =>
         {
             ostr.WriteString(value.ReturnValue);
             ostr.WriteString(value.s2);
         });
コード例 #7
0
ファイル: BlobjectI.cs プロジェクト: bernardnormier/ice
 public ValueTask <OutgoingResponseFrame> DispatchAsync(IncomingRequestFrame request, Current current)
 {
     if (current.Operation.Equals("opOneway"))
     {
         if (!current.IsOneway)
         {
             // If called two-way, return exception to caller.
             throw new MyException();
         }
         return(new ValueTask <OutgoingResponseFrame>(OutgoingResponseFrame.WithVoidReturnValue(current)));
     }
     else if (current.Operation.Equals("opString"))
     {
         string s             = request.ReadParamList(current.Communicator, InputStream.IceReaderIntoString);
         var    responseFrame = OutgoingResponseFrame.WithReturnValue(current, format: null, (s, s),
                                                                      (OutputStream ostr, (string ReturnValue, string s2)value) =>
         {
             ostr.WriteString(value.ReturnValue);
             ostr.WriteString(value.s2);
         });