コード例 #1
0
        /// <summary>
        /// Does the out in op.
        /// </summary>
        private T DoOutInOp <T>(ClientOp opId, Action <BinaryWriter> writeAction,
                                Func <IBinaryStream, T> readFunc)
        {
            return(_socket.DoOutInOp(opId, stream =>
            {
                if (writeAction != null)
                {
                    var writer = _marsh.StartMarshal(stream);

                    writeAction(writer);

                    _marsh.FinishMarshal(writer);
                }
            }, readFunc));
        }
コード例 #2
0
 /** <inheritdoc /> */
 public BinaryType GetBinaryType(int typeId)
 {
     return(_socket.DoOutInOp(ClientOp.BinaryTypeGet, s => s.WriteInt(typeId),
                              s => s.ReadBool() ? new BinaryType(_marsh.StartUnmarshal(s), true) : null));
 }