Exemplo n.º 1
0
 public void Process(StreamMode mode, StreamData data, Action <byte[], int> callback)
 {
     if (!_disposed)
     {
         var request = new AsyncStreamRequest(mode, data, callback);
         var task    = new StreamTask(GetIdleUnit(), request);
         ThreadPool.QueueUserWorkItem(_ => { task.Run(); });
     }
 }
Exemplo n.º 2
0
 public StreamTask(StreamUnit streamUnit, AsyncStreamRequest request)
 {
     _streamUnit      = streamUnit;
     _request         = request;
     _streamUnit.Busy = true;
 }