예제 #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);
            }
예제 #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();
        }
예제 #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();
        }