示例#1
0
            internal Attempt(SocketRemote remote)
            {
                _remote = remote;

                _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                _socket.BeginConnect(_remote.getAddress().Host, _remote.getAddress().Port, EndConnect, null);
            }
示例#2
0
            internal Attempt(SocketRemote remote)
            {
                _remote = remote;

                _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                _socket.BeginConnect(_remote.getAddress().Host, _remote.getAddress().Port, EndConnect, null);
            }
        internal SocketConnection(URIResolver server, SocketRemote client, Socket socket)
            : base(server, client)
        {
            _socket = socket;

            setActor(new SocketActor(this));

            Buff buff = Buff.getOrCreate();
            int position = buff.position();
            startWrite(buff);
            buff.limit(buff.position());
            buff.position(position);

            if (Debug.ENABLED)
                buff.@lock(buff.limit());

            _socket.BeginSend(buff.getByteBuffer().array(), buff.position(), buff.remaining(), SocketFlags.None, Connected, buff);

            BeginReceive();
        }
示例#4
0
        internal SocketConnection(URIResolver server, SocketRemote client, Socket socket)
            : base(server, client)
        {
            _socket = socket;

            setActor(new SocketActor(this));

            Buff buff     = Buff.getOrCreate();
            int  position = buff.position();

            startWrite(buff);
            buff.limit(buff.position());
            buff.position(position);

            if (Debug.ENABLED)
            {
                buff.@lock(buff.limit());
            }

            _socket.BeginSend(buff.getByteBuffer().array(), buff.position(), buff.remaining(), SocketFlags.None, Connected, buff);

            BeginReceive();
        }