Exemplo n.º 1
0
 public UdpSocketReceive(SocketStatus status, int count, UdpSocket socket, SocketBuffer buffer, byte[] address)
 {
     this.status  = status;
     this.count   = count;
     this.socket  = socket;
     this.buffer  = buffer;
     this.address = address;
 }
Exemplo n.º 2
0
 public UdpSocketSend(SocketStatus status, int count, UdpSocket socket, SocketBuffer buffer, IPEndPoint endpoint)
 {
     this.status   = status;
     this.count    = count;
     this.socket   = socket;
     this.buffer   = buffer;
     this.endpoint = endpoint;
 }
Exemplo n.º 3
0
        public void Receive(SocketBuffer buffer, TcpSocketReceiveCallback callback)
        {
            TcpSocketReceiveRoutine routine = new TcpSocketReceiveRoutine(handle, buffer);
            TcpSocketReceiveResult  result  = new TcpSocketReceiveResult
            {
                Socket     = this,
                Buffer     = buffer,
                OnReceived = callback
            };

            routine.Execute(result);
        }
Exemplo n.º 4
0
        public void Send(SocketBuffer buffer, TcpSocketSendCallback callback)
        {
            TcpSocketSendRoutine routine = new TcpSocketSendRoutine(handle, buffer);
            TcpSocketSendResult  result  = new TcpSocketSendResult
            {
                Socket = this,
                Buffer = buffer,
                OnSent = callback
            };

            routine.Execute(result);
        }
Exemplo n.º 5
0
        public void Send(IPEndPoint endpoint, SocketBuffer buffer, UdpSocketSendCallback callback)
        {
            UdpSocketSendRoutine routine = new UdpSocketSendRoutine(handle, endpoint, buffer);
            UdpSocketSendResult  result  = new UdpSocketSendResult
            {
                Socket   = this,
                Buffer   = buffer,
                OnSent   = callback,
                Endpoint = endpoint
            };

            routine.Execute(result);
        }
Exemplo n.º 6
0
        public Task <TcpSocketReceive> Receive(SocketBuffer buffer)
        {
            TcpSocketReceiveResult result = new TcpSocketReceiveResult
            {
                Socket = this,
                Buffer = buffer,
                Event  = new ManualResetEvent(false)
            };

            Task <TcpSocketReceive> task    = Task.Factory.FromAsync(result, ar => ((TcpSocketReceiveResult)ar).CreateData());
            TcpSocketReceiveRoutine routine = new TcpSocketReceiveRoutine(handle, buffer);

            routine.Execute(result);
            return(task);
        }
Exemplo n.º 7
0
 public Task <UdpSocketReceive> Receive(SocketBuffer buffer)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 public Task <UdpSocketSend> Send(IPEndPoint endpoint, SocketBuffer buffer)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public UdpSocketReceiveRoutine(IntPtr handle, SocketBuffer buffer)
 {
     this.handle = handle;
     this.buffer = buffer;
 }
Exemplo n.º 10
0
 public TcpSocketSendRoutine(IntPtr handle, SocketBuffer buffer)
 {
     this.handle = handle;
     this.buffer = buffer;
 }
Exemplo n.º 11
0
 public UdpSocketSendRoutine(IntPtr handle, IPEndPoint endpoint, SocketBuffer buffer)
 {
     this.handle   = handle;
     this.endpoint = endpoint;
     this.buffer   = buffer;
 }