/// <summary>
        /// This loop sends queued messages.
        /// </summary>
        private void ProcessQueue()
        {
            while(m_Running){
                try{
                    /* Get relay job from queue.
                       Relay queue is with priority 1.
                       Retry queue is with priority 2.

                       This assures that retry attempt connections won't use all allowed connections.
                    */

                    // There are no relay jobs available now or maximum allowed relay connections reached.
                    // Just fall down 'while', sleep a little and try with next while loop.
                    if(!(m_pRelayQueue.Count == 0 && m_pRelayRetryQueue.Count == 0) && m_pSessions.Count < m_MaxConnections){
                        lock(this){
                            string file = "";
                            // Relay job available, get it, because it's with higher priority.
                            if(m_pRelayQueue.Count > 0){
                                file = m_pRelayQueue.Dequeue();
                            }
                            // Relay retry job.
                            else{
                                file = m_pRelayRetryQueue.Dequeue();
                            }

                            try{
                                bool relay_retry = true;
                                if(file.ToLower().IndexOf("retry") > -1){
                                    relay_retry = false;
                                }

                                Relay_Session session = new Relay_Session(this,file,relay_retry);
                                AddSession(session);

                                session.Start();
                            }
                            catch(IOException x){
                                // Just skip IO exceptions, they happen when incoming message storing hasn't
                                // completed yet and relay engine tries to relay this message.
                                string dummy = x.Message;
                            }
                        }
                    }
                }
                catch(Exception x){
                    Error.DumpError(m_pVirtualServer.Name,x);
                }

                // Sleep, otherwise run loop takes 100% CPU.
                Thread.Sleep(10);
            }
        }