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

DecodeAddress() private static method

Given a string containing an endpoint address like "tcp://127.0.0.1:5555, break-it-down into the address part ("127.0.0.1:5555") and the protocol part ("tcp").
private static DecodeAddress ( [ addr, string &address, string &protocol ) : void
addr [ a string denoting the endpoint, to take the parts from
address string the IP-address portion of the end-point address
protocol string the protocol portion of the end-point address (such as "tcp")
return void
        private static void DecodeAddress([NotNull] string addr, out string address, out string protocol)
        {
            const string protocolDelimeter = "://";
            int protocolDelimeterIndex = addr.IndexOf(protocolDelimeter, StringComparison.Ordinal);

            protocol = addr.Substring(0, protocolDelimeterIndex);
            address = addr.Substring(protocolDelimeterIndex + protocolDelimeter.Length);
        }