Ejemplo n.º 1
0
        public static void Encode(XdrDataOutputStream stream, Memo encodedMemo)
        {
            stream.WriteInt((int)encodedMemo.Discriminant.InnerValue);
            switch (encodedMemo.Discriminant.InnerValue)
            {
            case MemoType.MemoTypeEnum.MEMO_NONE:
                break;

            case MemoType.MemoTypeEnum.MEMO_TEXT:
                stream.WriteString(encodedMemo.Text);
                break;

            case MemoType.MemoTypeEnum.MEMO_ID:
                Uint64.Encode(stream, encodedMemo.Id);
                break;

            case MemoType.MemoTypeEnum.MEMO_HASH:
                Hash.Encode(stream, encodedMemo.Hash);
                break;

            case MemoType.MemoTypeEnum.MEMO_RETURN:
                Hash.Encode(stream, encodedMemo.RetHash);
                break;
            }
        }
Ejemplo n.º 2
0
 public static void Encode(XdrDataOutputStream stream, Hello encodedHello)
 {
     Uint32.Encode(stream, encodedHello.LedgerVersion);
     Uint32.Encode(stream, encodedHello.OverlayVersion);
     Uint32.Encode(stream, encodedHello.OverlayMinVersion);
     Hash.Encode(stream, encodedHello.NetworkID);
     stream.WriteString(encodedHello.VersionStr);
     stream.WriteInt(encodedHello.ListeningPort);
     NodeID.Encode(stream, encodedHello.PeerID);
     AuthCert.Encode(stream, encodedHello.Cert);
     Uint256.Encode(stream, encodedHello.Nonce);
 }
Ejemplo n.º 3
0
 public static void Encode(XdrDataOutputStream stream, PeerStats encodedPeerStats)
 {
     NodeID.Encode(stream, encodedPeerStats.Id);
     stream.WriteString(encodedPeerStats.VersionStr);
     Uint64.Encode(stream, encodedPeerStats.MessagesRead);
     Uint64.Encode(stream, encodedPeerStats.MessagesWritten);
     Uint64.Encode(stream, encodedPeerStats.BytesRead);
     Uint64.Encode(stream, encodedPeerStats.BytesWritten);
     Uint64.Encode(stream, encodedPeerStats.SecondsConnected);
     Uint64.Encode(stream, encodedPeerStats.UniqueFloodBytesRecv);
     Uint64.Encode(stream, encodedPeerStats.DuplicateFloodBytesRecv);
     Uint64.Encode(stream, encodedPeerStats.UniqueFetchBytesRecv);
     Uint64.Encode(stream, encodedPeerStats.DuplicateFetchBytesRecv);
     Uint64.Encode(stream, encodedPeerStats.UniqueFloodMessageRecv);
     Uint64.Encode(stream, encodedPeerStats.DuplicateFloodMessageRecv);
     Uint64.Encode(stream, encodedPeerStats.UniqueFetchMessageRecv);
     Uint64.Encode(stream, encodedPeerStats.DuplicateFetchMessageRecv);
 }
Ejemplo n.º 4
0
 public static void Encode(XdrDataOutputStream stream, Error encodedError)
 {
     ErrorCode.Encode(stream, encodedError.Code);
     stream.WriteString(encodedError.Msg);
 }
Ejemplo n.º 5
0
 public static void Encode(XdrDataOutputStream stream, String32 encodedString32)
 {
     stream.WriteString(encodedString32.InnerValue);
 }