GetLong() public method

public GetLong ( string key ) : long
key string
return long
 public void SetGetLong()
 {
     QuickFix.Dictionary d = new QuickFix.Dictionary();
     d.SetLong("LONGKEY1", 12);
     d.SetLong("LONGKEY2", 987362);
     d.SetString("BADLONGKEY", "AB12");
     Assert.That(d.GetLong("LONGKEY1"), Is.EqualTo(12));
     Assert.That(d.GetLong("LONGKEY2"), Is.EqualTo(987362));
     Assert.Throws <ConfigError>(delegate { d.GetLong("LONGKEY3"); });
     Assert.Throws <ConfigError>(delegate { d.GetLong("BADLONGKEY"); });
 }
Esempio n. 2
0
 public void SetGetLong()
 {
     QuickFix.Dictionary d = new QuickFix.Dictionary();
     d.SetLong("LONGKEY1", 12);
     d.SetLong("LONGKEY2", 987362);
     d.SetString("BADLONGKEY", "AB12");
     Assert.That(d.GetLong("LONGKEY1"), Is.EqualTo(12));
     Assert.That(d.GetLong("LONGKEY2"), Is.EqualTo(987362));
     Assert.Throws<ConfigError>(delegate { d.GetLong("LONGKEY3"); });
     Assert.Throws<ConfigError>(delegate { d.GetLong("BADLONGKEY"); });
 }
Esempio n. 3
0
        private AcceptorSocketDescriptor GetAcceptorSocketDescriptor(Dictionary dict)
        {
            int            port           = System.Convert.ToInt32(dict.GetLong(SessionSettings.SOCKET_ACCEPT_PORT));
            SocketSettings socketSettings = new SocketSettings();

            IPEndPoint socketEndPoint;

            if (dict.Has(SessionSettings.SOCKET_ACCEPT_HOST))
            {
                string      host  = dict.GetString(SessionSettings.SOCKET_ACCEPT_HOST);
                IPAddress[] addrs = Dns.GetHostAddresses(host);
                socketEndPoint = new IPEndPoint(addrs[0], port);
                // Set hostname (if it is not already configured)
                socketSettings.ServerCommonName = socketSettings.ServerCommonName ?? host;
            }
            else
            {
                socketEndPoint = new IPEndPoint(IPAddress.Any, port);
            }

            socketSettings.Configure(dict);


            AcceptorSocketDescriptor descriptor;

            if (!socketDescriptorForAddress_.TryGetValue(socketEndPoint, out descriptor))
            {
                descriptor = new AcceptorSocketDescriptor(socketEndPoint, socketSettings, dict);
                socketDescriptorForAddress_[socketEndPoint] = descriptor;
            }

            return(descriptor);
        }
        private AcceptorSocketDescriptor GetAcceptorSocketDescriptor(Dictionary dict)
        {
            int port = System.Convert.ToInt32(dict.GetLong(SessionSettings.SOCKET_ACCEPT_PORT));
            SocketSettings socketSettings = new SocketSettings();

            IPEndPoint socketEndPoint;
            if (dict.Has(SessionSettings.SOCKET_ACCEPT_HOST))
            {
                string host = dict.GetString(SessionSettings.SOCKET_ACCEPT_HOST);                
                IPAddress[] addrs = Dns.GetHostAddresses(host);
                socketEndPoint = new IPEndPoint(addrs[0], port);
                // Set hostname (if it is not already configured)
                socketSettings.ServerCommonName = socketSettings.ServerCommonName ?? host;
            }
            else
            {
                socketEndPoint = new IPEndPoint(IPAddress.Any, port);
            }

            socketSettings.Configure(dict);
            

            AcceptorSocketDescriptor descriptor;
            if (!socketDescriptorForAddress_.TryGetValue(socketEndPoint, out descriptor))
            {
                descriptor = new AcceptorSocketDescriptor(socketEndPoint, socketSettings, dict);
                socketDescriptorForAddress_[socketEndPoint] = descriptor;
            }

            return descriptor;
        }