/// <summary> /// Creates a new instance of the <see cref="Packet"/> structure. /// </summary> /// <param name="src">The address of the origin of the packet.</param> /// <param name="dest">The address of final destination of the packet.</param> /// <param name="port">The port number of the packet.</param> /// <param name="id">The packet identifier (unique to the source instance).</param> /// <param name="data">The data contained in the packet.</param> public Packet(ErebusAddress src, ErebusAddress dest, ushort port, long id, byte[] data) { Source = src; Destination = dest; Port = port; Identifier = id; Data = data; }
/// <summary> /// Compares two <see cref="ErebusAddress"/> instances. /// </summary> /// <param name="obj"></param> /// <returns>Two if the two instances are equal, otherwise false.</returns> public override bool Equals(object obj) { if (!(obj is ErebusAddress)) { return(false); } ErebusAddress addr = (ErebusAddress)obj; return(Seg1 == addr.Seg1 && Seg2 == addr.Seg2 && Seg3 == addr.Seg3 && Seg4 == addr.Seg4 && Seg5 == addr.Seg5 && Seg6 == addr.Seg6 && Seg7 == addr.Seg7 && Seg8 == addr.Seg8); }
/// <summary> /// Creates a new instance of the <see cref="ConnectionFailedException"/> class, given the address of the remote computer, a message, and an inner exception. /// </summary> /// <param name="addr">The address of the remote computer.</param> /// <param name="message">The message of the exception.</param> /// <param name="inner">The inner exception.</param> public ConnectionFailedException(ErebusAddress addr, string message, Exception inner) : base(message, inner) { TargetAddress = addr; }
/// <summary> /// Creates a new instance of the <see cref="ConnectionFailedException"/> class, given the address of the remote computer. /// </summary> /// <param name="addr">The address of the remote computer.</param> public ConnectionFailedException(ErebusAddress addr) : base($"Failed to connect to target {addr}!") { TargetAddress = addr; }
/// <summary> /// Creates a new instance of the <see cref="ErebusAddress"/> class. /// </summary> /// <param name="addr">The address of the computer.</param> public ErebusInstance(ErebusAddress addr) { Address = addr; sendTask = sendProcess(); recvTask = recvProcess(); }