Detect if already running on port

Sep 8, 2007 at 12:52 PM
It would be good to have some code that detects if a current instance of SVNBridge is running on the requested port.
Something like this perhaps in \Presenters\ListenerViewPresenter.cs?

        public void StartListener()
        {
            try
            {
                listener.Start();
            }
            catch (SocketException e)
            {
                MessageBox.Show("There is already an instance SVNBridge running on the requested port.\r\nPlease close the other instance of SVNBridge.\r\nThis instance of SVNBridge will now close.", "SVNBridge already running", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.FailFast("SVNBridge already running on port.");
            }
            view.OnListenerStarted();
        }