NetMQ.Core.SessionBase.StartConnecting C# (CSharp) Method

StartConnecting() private method

Begin connecting.
private StartConnecting ( bool wait ) : void
wait bool Whether to wait a bit before actually attempting to connect
return void
        private void StartConnecting(bool wait)
        {
            Debug.Assert(m_connect);

            // Choose I/O thread to run connector in. Given that we are already
            // running in an I/O thread, there must be at least one available.
            IOThread ioThread = ChooseIOThread(m_options.Affinity);
            Debug.Assert(ioThread != null);

            // Create the connector object.

            switch (m_addr.Protocol)
            {
                case Address.TcpProtocol:
                {
                    LaunchChild(new TcpConnector(ioThread, this, m_options, m_addr, wait));
                    return;
                }
                case Address.IpcProtocol:
                {
                    LaunchChild(new IpcConnector(ioThread, this, m_options, m_addr, wait));
                    return;
                }
                case Address.PgmProtocol:
                case Address.EpgmProtocol:
                {
                    var pgmSender = new PgmSender(m_ioThread, m_options, m_addr, wait);
                    pgmSender.Init((PgmAddress)m_addr.Resolved);
                    SendAttach(this, pgmSender);
                    return;
                }
            }

            Debug.Assert(false);
        }