public void AddServer( string name, IPEndPoint address ) { AddServer( name, 0, TimeZone.CurrentTimeZone, address ); }
private static void EventSink_ServerList( ServerListEventArgs e ) { try { NetState ns = e.State; Socket s = ns.Socket; IPEndPoint ipep = (IPEndPoint)s.LocalEndPoint; IPAddress localAddress = ipep.Address; int localPort = ipep.Port; if ( IsPrivateNetwork( localAddress ) ) { ipep = (IPEndPoint)s.RemoteEndPoint; if ( !IsPrivateNetwork( ipep.Address ) && m_PublicAddress != null ) localAddress = m_PublicAddress; } e.AddServer( ServerName, new IPEndPoint( localAddress, localPort ) ); } catch { e.Rejected = true; } }