RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Listener.Port to IPEndPoint[]

RavonTUS

Sorceror
Listener.Port to IPEndPoint[]

Greetings,

With the recent SVN 264 change, Listener.Port was changed to IPEndPoint[] m_EndPoints, so it could read other ports than just 2593.

I am trying to fix a script that used Listern.Port and would like to know how to change it to do the range, instead of erroring out.

Code:
if (((IPEndPoint)from.Socket.LocalEndPoint).Port != Listener.Port)
{
//Do Stuff Here
}

What I think I need, but is wrong due to my lack of knowledge...
Code:
            IPEndPoint[] ipep = Listener.EndPoints;

            m_Listeners = new Listener[ipep.Length];

            bool success = false;

            do
            {
                for (int i = 0; i < ipep.Length; i++)
                {

                    if (((IPEndPoint)from.Socket.LocalEndPoint).Port != ipep.Length)
                    {
                        //Do Stuff Here
                        return;
                    }
                }

                if (!success)
                {
                    Console.WriteLine("Retrying...");
                    Thread.Sleep(10000);
                }
            } while (!success);

Any suggestions or hints?

-Ravon
 
Top