Exemplo n.º 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);
            }
Exemplo n.º 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);
            }
Exemplo n.º 3
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();
        }
Exemplo n.º 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();
        }