Added IDataReceiverSink and refactored to separate the EventSink from the GarbageData...
[lwes-dotnet/github-mirror.git] / Org.Lwes / Listener / Enums.cs
blob957cf4b2cbfc9d8d21fb290fe28c92284398f278
1 //
2 // This file is part of the LWES .NET Binding (LWES.net)
3 //
4 // COPYRIGHT© 2009, Phillip Clark (phillip[at*flitbit[dot*org)
5 // original .NET implementation
6 //
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
22 #region Enumerations
24 /// <summary>
25 /// Strategies to be taken when garbage data arrives from an endpoint.
26 /// </summary>
27 public enum GarbageHandlingVote
29 /// <summary>
30 /// No opinion on garbage handling. Continue as normal.
31 /// </summary>
32 None,
33 /// <summary>
34 /// Causes all traffic from an endpoint to be handled by the event
35 /// sink's HandleGarbageData.
36 /// </summary>
37 TreatTrafficFromEndpointAsGarbage,
38 /// <summary>
39 /// Causes any data received from the endpoint to be discarded as soon
40 /// as possible.
41 /// </summary>
42 IgnoreAllTrafficFromEndpoint,
43 /// <summary>
44 /// The default strategy. Same as None
45 /// </summary>
46 Default = None
49 /// <summary>
50 /// Enumeration for garbage handling strategy employed by Listeners.
51 /// </summary>
52 public enum ListenerGarbageHandling
54 /// <summary>
55 /// Indicates the listener should silently handle garbage data
56 /// but continue to accept data from all endpoints.
57 /// </summary>
58 FailSilently = 0,
59 /// <summary>
60 /// Indicates the listener should ignore data from endpoints
61 /// from which garbage has been received.
62 /// </summary>
63 IgnoreEndpointsThatSendGarbage = 1,
64 /// <summary>
65 /// Indicates the listener should ask the event sinks to vote
66 /// on the strategy on a per-endpoint basis.
67 /// </summary>
68 /// <see cref="Org.Lwes.Listener.IEventSink"/>
69 AskEventSinksToVoteOnStrategy = 2,
70 /// <summary>
71 /// The default value: FailSilently
72 /// </summary>
73 Default = FailSilently
76 /// <summary>
77 /// Represents the state of an event sink.
78 /// </summary>
79 public enum SinkStatus
81 /// <summary>
82 /// Indicates the event sink has been suspended and should not receive
83 /// events until activated. This is the initial state for new IEventSinkRegistrationKeys.
84 /// </summary>
85 Suspended = 0,
86 /// <summary>
87 /// Indicates the event sink is active and may be notified of events
88 /// at any time.
89 /// </summary>
90 Active = 1,
91 /// <summary>
92 /// For event sinks that are not thread-safe, indicates that the sink
93 /// is currently being invoked.
94 /// </summary>
95 Notifying = 2,
96 /// <summary>
97 /// Indicates the event sink has been canceled.
98 /// </summary>
99 Canceled = 3
102 #endregion Enumerations