Esempio n. 1
0
 public NetworkAddressWithTime With(UInt32? Time = null, NetworkAddress NetworkAddress = null)
 {
     return new NetworkAddressWithTime
     (
         Time ?? this.Time,
         NetworkAddress ?? this.NetworkAddress
     );
 }
Esempio n. 2
0
 public VersionPayload(UInt32 ProtocolVersion, UInt64 ServicesBitfield, UInt64 UnixTime, NetworkAddress RemoteAddress, NetworkAddress LocalAddress, UInt64 Nonce, string UserAgent, UInt32 StartBlockHeight, bool Relay)
 {
     this.ProtocolVersion = ProtocolVersion;
     this.ServicesBitfield = ServicesBitfield;
     this.UnixTime = UnixTime;
     this.RemoteAddress = RemoteAddress;
     this.LocalAddress = LocalAddress;
     this.Nonce = Nonce;
     this.UserAgent = UserAgent;
     this.StartBlockHeight = StartBlockHeight;
     this.Relay = Relay;
 }
Esempio n. 3
0
 public VersionPayload With(UInt32? ProtocolVersion = null, UInt64? ServicesBitfield = null, UInt64? UnixTime = null, NetworkAddress RemoteAddress = null, NetworkAddress LocalAddress = null, UInt64? Nonce = null, string UserAgent = null, UInt32? StartBlockHeight = null, bool? Relay = null)
 {
     return new VersionPayload
     (
         ProtocolVersion ?? this.ProtocolVersion,
         ServicesBitfield ?? this.ServicesBitfield,
         UnixTime ?? this.UnixTime,
         RemoteAddress ?? this.RemoteAddress,
         LocalAddress ?? this.LocalAddress,
         Nonce ?? this.Nonce,
         UserAgent ?? this.UserAgent,
         StartBlockHeight ?? this.StartBlockHeight,
         Relay ?? this.Relay
     );
 }
Esempio n. 4
0
 public static void EncodeNetworkAddress(BinaryWriter writer, NetworkAddress networkAddress)
 {
     writer.WriteUInt64(networkAddress.Services);
     writer.WriteBytes(16, networkAddress.IPv6Address.ToArray());
     writer.WriteUInt16BE(networkAddress.Port);
 }
Esempio n. 5
0
 public NetworkAddressWithTime(UInt32 Time, NetworkAddress NetworkAddress)
 {
     this.Time           = Time;
     this.NetworkAddress = NetworkAddress;
 }
Esempio n. 6
0
 public NetworkAddressWithTime(UInt32 Time, NetworkAddress NetworkAddress)
 {
     this.Time = Time;
     this.NetworkAddress = NetworkAddress;
 }
Esempio n. 7
0
 public static byte[] EncodeNetworkAddress(NetworkAddress networkAddress)
 {
     var stream = new MemoryStream();
     EncodeNetworkAddress(stream, networkAddress);
     return stream.ToArray();
 }
Esempio n. 8
0
 public static void EncodeNetworkAddress(Stream stream, NetworkAddress networkAddress)
 {
     using (var writer = new BinaryWriter(stream, Encoding.ASCII, leaveOpen: true))
     {
         writer.Write8Bytes(networkAddress.Services);
         writer.WriteBytes(16, networkAddress.IPv6Address.ToArray());
         writer.Write2BytesBE(networkAddress.Port);
     }
 }
Esempio n. 9
0
 public VersionPayload(UInt32 ProtocolVersion, UInt64 ServicesBitfield, UInt64 UnixTime, NetworkAddress RemoteAddress, NetworkAddress LocalAddress, UInt64 Nonce, string UserAgent, UInt32 StartBlockHeight, bool Relay)
 {
     this.ProtocolVersion  = ProtocolVersion;
     this.ServicesBitfield = ServicesBitfield;
     this.UnixTime         = UnixTime;
     this.RemoteAddress    = RemoteAddress;
     this.LocalAddress     = LocalAddress;
     this.Nonce            = Nonce;
     this.UserAgent        = UserAgent;
     this.StartBlockHeight = StartBlockHeight;
     this.Relay            = Relay;
 }
Esempio n. 10
0
 public VersionPayload With(UInt32?ProtocolVersion = null, UInt64?ServicesBitfield = null, UInt64?UnixTime = null, NetworkAddress RemoteAddress = null, NetworkAddress LocalAddress = null, UInt64?Nonce = null, string UserAgent = null, UInt32?StartBlockHeight = null, bool?Relay = null)
 {
     return(new VersionPayload
            (
                ProtocolVersion ?? this.ProtocolVersion,
                ServicesBitfield ?? this.ServicesBitfield,
                UnixTime ?? this.UnixTime,
                RemoteAddress ?? this.RemoteAddress,
                LocalAddress ?? this.LocalAddress,
                Nonce ?? this.Nonce,
                UserAgent ?? this.UserAgent,
                StartBlockHeight ?? this.StartBlockHeight,
                Relay ?? this.Relay
            ));
 }