public override void WriteBody(STUNBinaryWriter binary) { binary.Write(Three0); int i = 0; if (ChangeIP) { i |= 4; } if (ChangePort) { i |= 2; } binary.Write((byte)i); }
public override void WriteBody(STUNBinaryWriter binary) { binary.Write((byte)0); if (EndPoint.AddressFamily == AddressFamily.InterNetwork) { binary.Write((byte)1); } else if (EndPoint.AddressFamily == AddressFamily.InterNetworkV6) { binary.Write((byte)2); } else { throw new Exception("Unsupported IP Family" + EndPoint.AddressFamily.ToString()); } binary.Write((ushort)EndPoint.Port); var addressBytes = EndPoint.Address.GetAddressBytes(); binary.Write(addressBytes); }
public override void WriteBody(STUNBinaryWriter binary) { throw new NotImplementedException(); }
public override void WriteBody(STUNBinaryWriter binary) { binary.Write(Encoding.ASCII.GetBytes(Text)); }