NetMQ.Core.SocketBase.CheckProtocol C# (CSharp) Method

CheckProtocol() private method

Check whether the transport protocol, as specified in connect or bind, is available and compatible with the socket type.
The supported protocols are "inproc", "ipc", "tcp", "pgm", and "epgm". If the protocol is either "pgm" or "epgm", then this socket must be of type Pub, Sub, XPub, or XSub.
the specified protocol is not supported the socket type and protocol do not match
private CheckProtocol ( [ protocol ) : void
protocol [
return void
        private void CheckProtocol([NotNull] string protocol)
        {
            switch (protocol)
            {
                case Address.InProcProtocol:
                case Address.IpcProtocol:
                case Address.TcpProtocol:
                    // All is well
                    break;
                case Address.PgmProtocol:
                case Address.EpgmProtocol:
                    // Check whether socket type and transport protocol match.
                    // Specifically, multicast protocols can't be combined with
                    // bi-directional messaging patterns (socket types).
                    switch (m_options.SocketType)
                    {
                        case ZmqSocketType.Pub:
                        case ZmqSocketType.Sub:
                        case ZmqSocketType.Xpub:
                        case ZmqSocketType.Xsub:
                            // All is well
                            break;
                        default:
                            throw new ProtocolNotSupportedException(
                                "Multicast protocols are not supported by socket type: " + m_options.SocketType);
                    }
                    break;
                default:
                    throw new ProtocolNotSupportedException("Invalid protocol: " + protocol);
            }
        }