Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

Commit

Permalink
Moved UseIPv6 property to XmppSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesgroenewald1 committed May 8, 2017
1 parent 3c741f8 commit d1825b5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions TestXMPP/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private void Button1Click(object sender, EventArgs e)
Xmpp.Settings.Hostname = fcm_server;
Xmpp.Settings.Port = fcm_dev_port;
Xmpp.Settings.Ssl = btnSSL.Checked;
ProtocolState.UseIPv6 = false;
Xmpp.Settings.UseIPv6 = false;
ProtocolState.Settings.Ssl = true;
_xmpp.Connect();
}
Expand All @@ -57,7 +57,7 @@ private void BtnSendClick(object sender, EventArgs e)

private void Main_FormClosing(object sender, FormClosingEventArgs e)
{
Serilog.Log.Debug("Disposing xmpp object on form exit");
Serilog.Log.Debug("Disconnecting from server");
if (_xmpp != null && Xmpp.Connected)
_xmpp.Disconnect();
}
Expand Down
5 changes: 5 additions & 0 deletions ubiety/Infrastructure/XmppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,10 @@ public int Port
/// The disco manager.
/// </value>
public IDiscoManager DiscoManager { get; set; }

/// <summary>
///
/// </summary>
public bool UseIPv6 { get; set; }
}
}
2 changes: 1 addition & 1 deletion ubiety/Net/Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private IPAddress Resolve(string hostname)

Log.Debug("Trying standard lookup for {0}...", hostname);

if (Socket.OSSupportsIPv6 && ProtocolState.UseIPv6)
if (Socket.OSSupportsIPv6 && ProtocolState.Settings.UseIPv6)
{
Log.Debug("Trying IPv6 resolution...");
resp = _resolver.Query(hostname, QType.AAAA, QClass.IN);
Expand Down
5 changes: 0 additions & 5 deletions ubiety/States/ProtocolState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ private static void EventsOnOnSend(object sender, TagEventArgs tagEventArgs)
/// </summary>
public static IRosterManager RosterManager { get; set; }

/// <summary>
///
/// </summary>
public static bool UseIPv6 { get; set; }

/// <summary>
///
/// </summary>
Expand Down

0 comments on commit d1825b5

Please sign in to comment.