2 // This file is part of the LWES .NET Binding (LWES.net)
4 // COPYRIGHT© 2009, Phillip Clark (phillip[at*flitbit[dot*org)
5 // original .NET implementation
7 // LWES.net is free software: you can redistribute it and/or modify
8 // it under the terms of the Lesser GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // LWES.net is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // Lesser GNU General Public License for more details.
17 // You should have received a copy of the Lesser GNU General Public License
18 // along with LWES.net. If not, see <http://www.gnu.org/licenses/>.
20 namespace Org
.Lwes
.Listener
26 /// Interface for event listener implementations.
28 public interface IEventListener
: IDisposable
31 /// Occurs when an LWES event arrives.
33 event OnLwesEventArrived OnEventArrived
;
36 /// Occurs when garbage data is received by the listener.
38 event OnLwesGarbageArrived OnGarbageArrived
;
41 /// The ip address where the listener will listen.
43 /// <exception cref="System.InvalidOperationException">thrown if the listener has already been initialized</exception>
51 /// The ip port where the listener will listen.
53 /// <exception cref="System.InvalidOperationException">thrown if the listener has already been initialized</exception>
61 /// Initializes the listener.
63 /// <exception cref="System.InvalidOperationException">thrown if the listener has already been initialized</exception>
67 /// Registers a data receiver sink with the listener without activating the
70 /// <param name="sink">the sink to register</param>
71 /// <returns>A registration key for the sink</returns>
72 /// <remarks>Sinks will not begin to recieve notification
73 /// until <em>after</em> the registration key's <see cref="ISinkRegistrationKey.Activate"/>
74 /// method is called.</remarks>
75 ISinkRegistrationKey
RegisterDataReceiverSink(IDataReceiverSink sink
);
78 /// Registers an event sink with the listener without activating the
81 /// <param name="sink">the event sink to register</param>
82 /// <returns>A registration key for the event sink</returns>
83 /// <remarks>Sinks will not begin to recieve event notification
84 /// until <em>after</em> the registration key's <see cref="ISinkRegistrationKey.Activate"/>
85 /// method is called.</remarks>
86 ISinkRegistrationKey
RegisterEventSink(IEventSink sink
);
89 /// Registers a garbage sink with the listener without activating.
91 /// <param name="sink">the sink to register</param>
92 /// <returns>A registration key for the sink</returns>
93 /// <remarks>Sinks will not begin to recieve garbage notification
94 /// until <em>after</em> the registration key's <see cref="ISinkRegistrationKey.Activate"/>
95 /// method is called.</remarks>
96 ISinkRegistrationKey
RegisterGarbageSink(IGarbageSink sink
);