public void StartReceiver() { TRACE("START RECEIVER"); receiver_running = true; var block = new StreamBlock { ContentType = StreamBlock.ContentTypes.StreamData, Data = new byte[MaxBlockSize], TotalBytes = MaxBlockSize }; os_socket.BeginReceive(block.Data, 0, block.TotalBytes, 0, ReadAsyncResult, block); }
/// <summary> /// callback, este metodo es llamado cuando se reciben datos por el socket. /// </summary> public abstract void OnReceive(StreamBlock block);
public virtual void EnqueueBlock(StreamBlock block) { TRACE("ENQUEUE BLOCK [{0}] OF {1} BYTES", block.ContentType, block.TotalBytes); outgoing_stream.Enqueue(block); }
public override void OnReceive(StreamBlock block) { TRACE("SERVER ON RECEIVE"); Target.EnqueueBlock(block); }
public override void OnReceive(StreamBlock block) { TRACE("CLIENT ON RECEIVE"); Source.EnqueueBlock(block); }