Exemple #1
0
        public StreamSocket(ProtocolInstance instance, NetworkProxy proxy, EndPoint addr, EndPoint sourceAddr)
        {
            _instance = instance;
            _proxy = proxy;
            _addr = addr;
            _sourceAddr = sourceAddr;
            _fd = Network.createSocket(false, (_proxy != null ? _proxy.getAddress() : _addr).AddressFamily);
            _state = StateNeedConnect;

            init();
        }
Exemple #2
0
        //
        // Only for use by EndpointI.
        //
        internal ConnectorI(Instance instance, string host, EndPoint addr, IceInternal.NetworkProxy proxy, int timeout,
                            string conId)
        {
            _instance     = instance;
            _host         = host;
            _logger       = instance.communicator().getLogger();
            _addr         = (IPEndPoint)addr;
            _proxy        = proxy;
            _timeout      = timeout;
            _connectionId = conId;

            _hashCode = 5381;
            IceInternal.HashUtil.hashAdd(ref _hashCode, _addr);
            IceInternal.HashUtil.hashAdd(ref _hashCode, _timeout);
            IceInternal.HashUtil.hashAdd(ref _hashCode, _connectionId);
        }
Exemple #3
0
        //
        // Only for use by EndpointI.
        //
        internal ConnectorI(Instance instance, string host, EndPoint addr, IceInternal.NetworkProxy proxy,
            EndPoint sourceAddr, int timeout, string conId)
        {
            _instance = instance;
            _host = host;
            _addr = (IPEndPoint)addr;
            _proxy = proxy;
            _sourceAddr = sourceAddr;
            _timeout = timeout;
            _connectionId = conId;

            _hashCode = 5381;
            IceInternal.HashUtil.hashAdd(ref _hashCode, _addr);
            if(_sourceAddr != null)
            {
                IceInternal.HashUtil.hashAdd(ref _hashCode, _sourceAddr);
            }
            IceInternal.HashUtil.hashAdd(ref _hashCode, _timeout);
            IceInternal.HashUtil.hashAdd(ref _hashCode, _connectionId);
        }
Exemple #4
0
        //
        // Only for use by EndpointI.
        //
        internal ConnectorI(Instance instance, string host, EndPoint addr, IceInternal.NetworkProxy proxy,
                            EndPoint sourceAddr, int timeout, string conId)
        {
            _instance     = instance;
            _host         = host;
            _addr         = (IPEndPoint)addr;
            _proxy        = proxy;
            _sourceAddr   = sourceAddr;
            _timeout      = timeout;
            _connectionId = conId;

            _hashCode = 5381;
            IceInternal.HashUtil.hashAdd(ref _hashCode, _addr);
            if (_sourceAddr != null)
            {
                IceInternal.HashUtil.hashAdd(ref _hashCode, _sourceAddr);
            }
            IceInternal.HashUtil.hashAdd(ref _hashCode, _timeout);
            IceInternal.HashUtil.hashAdd(ref _hashCode, _connectionId);
        }
Exemple #5
0
        //
        // Only for use by ConnectorI, AcceptorI.
        //
        internal TransceiverI(Instance instance, Socket fd, string host, bool connected,
                              bool incoming, string adapterName, IPEndPoint addr, IceInternal.NetworkProxy proxy)
        {
            _instance    = instance;
            _fd          = fd;
            _host        = host;
            _incoming    = incoming;
            _adapterName = adapterName;
            _addr        = addr;
            _proxy       = proxy;
            _stream      = null;
            _logger      = instance.communicator().getLogger();
            _stats       = instance.communicator().getStats();
            _desc        = connected ? IceInternal.Network.fdToString(_fd, _proxy, _addr) : "<not connected>";
            _state       = connected ? StateNeedAuthenticate : StateNeedConnect;

            _maxSendPacketSize = IceInternal.Network.getSendBufferSize(fd);
            if (_maxSendPacketSize < 512)
            {
                _maxSendPacketSize = 0;
            }

            _maxReceivePacketSize = IceInternal.Network.getRecvBufferSize(fd);
            if (_maxReceivePacketSize < 512)
            {
                _maxReceivePacketSize = 0;
            }

            if (_adapterName != null)
            {
                //
                // Determine whether a certificate is required from the peer.
                //
                _verifyPeer =
                    _instance.communicator().getProperties().getPropertyAsIntWithDefault("IceSSL.VerifyPeer", 2);
            }
            else
            {
                _verifyPeer = 0;
            }
        }
Exemple #6
0
        public override List <IceInternal.Connector> connectors(List <EndPoint> addresses, IceInternal.NetworkProxy proxy)
        {
            List <IceInternal.Connector> connectors = new List <IceInternal.Connector>();

            foreach (EndPoint addr in addresses)
            {
                connectors.Add(new ConnectorI(_instance, _host, addr, proxy, _timeout, connectionId_));
            }
            return(connectors);
        }
Exemple #7
0
 protected override IceInternal.Connector createConnector(EndPoint addr, IceInternal.NetworkProxy proxy)
 {
     return(new ConnectorI(_instance, host_, addr, proxy, sourceAddr_, _timeout, connectionId_));
 }