Ejemplo n.º 1
0
        /// <summary>
        /// Suspends the networking thread for N milliseconds.
        /// Usefull for simulating unusual networking conditions.
        /// </summary>
        /// <param name="milliseconds">How long to sleep</param>
        public void Sleep(int milliseconds)
        {
#if DEBUG
            Raise(UdpEvent.INTERNAL_SLEEP, milliseconds);
#else
            UdpLog.Warn("Calling UdpSocket.Sleep in non-debug build is not supported");
#endif
        }
Ejemplo n.º 2
0
        UdpConnection CreateConnection(UdpEndPoint endpoint, UdpConnectionMode mode)
        {
            if (connLookup.ContainsKey(endpoint))
            {
                UdpLog.Warn("connection for {0} already exists", endpoint);
                return(default(UdpConnection));
            }

            UdpConnection cn = new UdpConnection(this, mode, endpoint);

            connLookup.Add(endpoint, cn);
            connList.Add(cn);

            return(cn);
        }