Added IDataReceiverSink and refactored to separate the EventSink from the GarbageData...
[lwes-dotnet/github-mirror.git] / Org.Lwes / Listener / IDataReceiverSink.cs
blobde7184705fb0e751520851d37ce395022b28a110
1 #region Header
3 //
4 // This file is part of the LWES .NET Binding (LWES.net)
5 //
6 // COPYRIGHT© 2009, Phillip Clark (phillip[at*flitbit[dot*org)
7 // original .NET implementation
8 //
9 // LWES.net is free software: you can redistribute it and/or modify
10 // it under the terms of the Lesser GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
14 // LWES.net is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // Lesser GNU General Public License for more details.
19 // You should have received a copy of the Lesser GNU General Public License
20 // along with LWES.net. If not, see <http://www.gnu.org/licenses/>.
23 #endregion Header
25 namespace Org.Lwes.Listener
27 using System.Net;
29 /// <summary>
30 /// Interface for classes that handle the arrival of LWES data.
31 /// </summary>
32 public interface IDataReceiverSink
34 /// <summary>
35 /// Callback method invoked by event listeners when data arrives on an endpoint.
36 /// </summary>
37 /// <param name="key">Registration key for controlling the sink's registration</param>
38 /// <param name="data">a byte array containing data received from the endpoint</param>
39 /// <param name="count">number of bytes received</param>
40 /// <param name="offset">offset to the first data byte in the buffer</param>
41 /// <param name="remoteEP">remote endpoint that sent the data</param>
42 /// <returns><em>true</em> if the listener should continue notifying the sink-chain; otherwise <em>false</em></returns>
43 bool HandleData(ISinkRegistrationKey key, EndPoint remoteEP, byte[] data, int offset, int count);