Exemplo n.º 1
0
 internal asyncReceiveState(MSR.LST.Net.Sockets.Socket sock, BufferChunk bufferChunk, Queue queue, ReceivedFromCallback receivedFromCallback)
 {
     this.sock = sock;
     this.bufferChunk = bufferChunk;
     this.queue = queue;
     this.receivedFromCallback = receivedFromCallback;
 }
Exemplo n.º 2
0
        public void AsyncReceiveFrom(Queue queueOfBufferChunks, ReceivedFromCallback callback)
        {
            if (disposed) // This continues in the background, so shut down if disposed
            {
                return;
            }
            // Set up the state
            IPEndPoint        sender   = new IPEndPoint(IPAddress.Any, 0);
            EndPoint          senderEP = (EndPoint)sender;
            BufferChunk       bc       = (BufferChunk)queueOfBufferChunks.Dequeue();
            asyncReceiveState ars      = new asyncReceiveState(this.sock, bc, queueOfBufferChunks, callback);

            // Start the ReceiveFrom
            sock.BeginReceiveFrom(bc, ref senderEP, new AsyncCallback(asyncReceiveCallback), ars);
        }
Exemplo n.º 3
0
        public void AsyncReceiveFrom(Queue queueOfBufferChunks, ReceivedFromCallback callback)
        {
            if (disposed) // This continues in the background, so shut down if disposed
            {
                return;
            }
            // Set up the state
            IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
            EndPoint senderEP = (EndPoint)sender;
            BufferChunk bc = (BufferChunk)queueOfBufferChunks.Dequeue();
            asyncReceiveState ars = new asyncReceiveState(this.sock, bc, queueOfBufferChunks, callback);

            // Start the ReceiveFrom
            sock.BeginReceiveFrom(bc, ref senderEP, new AsyncCallback(asyncReceiveCallback), ars);
        }
Exemplo n.º 4
0
 internal asyncReceiveState(MSR.LST.Net.Sockets.Socket sock, BufferChunk bufferChunk, Queue queue, ReceivedFromCallback receivedFromCallback)
 {
     this.sock                 = sock;
     this.bufferChunk          = bufferChunk;
     this.queue                = queue;
     this.receivedFromCallback = receivedFromCallback;
 }
Exemplo n.º 5
0
 internal asyncReceiveState(TSocket sock, BufferChunk bufferChunk, Queue<BufferChunk> queue, ReceivedFromCallback receivedFromCallback)
 {
     this.sock = sock;
     this.bufferChunk = bufferChunk;
     this.queue = queue;
     this.receivedFromCallback = receivedFromCallback;
 }