Skip to content

Commit dd640a4

Browse files
Copilotdrewnoakes
andcommitted
Improve documentation: fix property docs, populate empty elements, add periods, use cref, add inheritdoc
Co-authored-by: drewnoakes <[email protected]>
1 parent b6b048f commit dd640a4

File tree

2 files changed

+32
-85
lines changed

2 files changed

+32
-85
lines changed

src/NetMQ/Monitoring/INetMQMonitor.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ namespace NetMQ.Monitoring
99
public interface INetMQMonitor : IDisposable
1010
{
1111
/// <summary>
12-
/// The monitoring address.
12+
/// Gets the monitoring address.
1313
/// </summary>
1414
string Endpoint { get; }
1515

1616
/// <summary>
17-
/// Get whether this monitor is currently running.
17+
/// Gets whether this monitor is currently running.
1818
/// </summary>
1919
/// <remarks>
2020
/// Start the monitor running via either <see cref="Start"/> or <see cref="AttachToPoller{T}"/>.
@@ -87,35 +87,35 @@ public interface INetMQMonitor : IDisposable
8787
event EventHandler<NetMQMonitorSocketEventArgs>? Disconnected;
8888

8989
/// <summary>
90-
/// Add the monitor object to a NetMQPoller, register to <see cref="EventReceived"/> to be signalled on new events
90+
/// Adds the monitor object to a NetMQPoller. Register to <see cref="EventReceived"/> to be signalled on new events.
9191
/// </summary>
92-
/// <param name="poller"></param>
93-
/// <typeparam name="T"></typeparam>
94-
/// <exception cref="ArgumentNullException"></exception>
95-
/// <exception cref="InvalidOperationException"></exception>
92+
/// <param name="poller">The poller to attach to.</param>
93+
/// <typeparam name="T">The type of poller.</typeparam>
94+
/// <exception cref="ArgumentNullException">The <paramref name="poller"/> is <c>null</c>.</exception>
95+
/// <exception cref="InvalidOperationException">The monitor is already started or already attached to a poller.</exception>
9696
void AttachToPoller<T>(T poller) where T : INetMQPoller;
9797

9898
/// <summary>
99-
/// Remove the monitor object from attached poller
99+
/// Removes the monitor object from the attached poller.
100100
/// </summary>
101101
void DetachFromPoller();
102102

103103
/// <summary>
104-
/// Start monitor the socket, the method doesn't start a new thread and will block until the monitor poll is stopped
104+
/// Starts monitoring the socket. This method doesn't start a new thread and will block until the monitor poll is stopped.
105105
/// </summary>
106106
/// <exception cref="InvalidOperationException">The Monitor must not have already started nor attached to a poller.</exception>
107107
void Start();
108108

109109
/// <summary>
110-
/// Start a background task for the monitoring operation.
110+
/// Starts a background task for the monitoring operation.
111111
/// </summary>
112-
/// <returns></returns>
112+
/// <returns>A task representing the monitoring operation.</returns>
113113
Task StartAsync();
114114

115115
/// <summary>
116-
/// Stop monitoring. Blocks until monitoring completed.
116+
/// Stops monitoring. Blocks until monitoring completed.
117117
/// </summary>
118-
/// <exception cref="InvalidOperationException">If this monitor is attached to a poller you must detach it first and not use the stop method.</exception>
118+
/// <exception cref="InvalidOperationException">If this monitor is attached to a poller you must detach it first and not use the <see cref="Stop"/> method.</exception>
119119
void Stop();
120120
}
121121
}

src/NetMQ/Monitoring/NetMQMonitor.cs

Lines changed: 19 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -68,84 +68,48 @@ public NetMQMonitor(NetMQSocket socket, string endpoint, bool ownsSocket = false
6868
m_ownsMonitoringSocket = ownsSocket;
6969
}
7070

71-
/// <summary>
72-
/// The monitoring address.
73-
/// </summary>
71+
/// <inheritdoc />
7472
public string Endpoint { get; }
7573

76-
/// <summary>
77-
/// Get whether this monitor is currently running.
78-
/// </summary>
79-
/// <remarks>
80-
/// Start the monitor running via either <see cref="Start"/> or <see cref="AttachToPoller{T}"/>.
81-
/// Stop the monitor via either <see cref="Stop"/> or <see cref="DetachFromPoller()"/>.
82-
/// </remarks>
74+
/// <inheritdoc />
8375
public bool IsRunning { get; private set; }
8476

85-
/// <summary>
86-
/// Gets and sets the timeout interval for poll iterations when using <see cref="Start"/> and <see cref="Stop"/>.
87-
/// </summary>
88-
/// <remarks>
89-
/// The higher the number the longer it may take the to stop the monitor.
90-
/// This value has no effect when the monitor is run via <see cref="AttachToPoller{T}"/>.
91-
/// </remarks>
77+
/// <inheritdoc />
9278
public TimeSpan Timeout { get; set; }
9379

9480
#region Events
9581

96-
/// <summary>
97-
/// Raised whenever any monitored event fires.
98-
/// </summary>
82+
/// <inheritdoc />
9983
public event EventHandler<NetMQMonitorEventArgs>? EventReceived;
10084

101-
/// <summary>
102-
/// Occurs when a connection is made to a socket.
103-
/// </summary>
85+
/// <inheritdoc />
10486
public event EventHandler<NetMQMonitorSocketEventArgs>? Connected;
10587

106-
/// <summary>
107-
/// Occurs when a synchronous connection attempt failed, and its completion is being polled for.
108-
/// </summary>
88+
/// <inheritdoc />
10989
public event EventHandler<NetMQMonitorErrorEventArgs>? ConnectDelayed;
11090

111-
/// <summary>
112-
/// Occurs when an asynchronous connect / reconnection attempt is being handled by a reconnect timer.
113-
/// </summary>
91+
/// <inheritdoc />
11492
public event EventHandler<NetMQMonitorIntervalEventArgs>? ConnectRetried;
11593

116-
/// <summary>
117-
/// Occurs when a socket is bound to an address and is ready to accept connections.
118-
/// </summary>
94+
/// <inheritdoc />
11995
public event EventHandler<NetMQMonitorSocketEventArgs>? Listening;
12096

121-
/// <summary>
122-
/// Occurs when a socket could not bind to an address.
123-
/// </summary>
97+
/// <inheritdoc />
12498
public event EventHandler<NetMQMonitorErrorEventArgs>? BindFailed;
12599

126-
/// <summary>
127-
/// Occurs when a connection from a remote peer has been established with a socket's listen address.
128-
/// </summary>
100+
/// <inheritdoc />
129101
public event EventHandler<NetMQMonitorSocketEventArgs>? Accepted;
130102

131-
/// <summary>
132-
/// Occurs when a connection attempt to a socket's bound address fails.
133-
/// </summary>
103+
/// <inheritdoc />
134104
public event EventHandler<NetMQMonitorErrorEventArgs>? AcceptFailed;
135105

136-
/// <summary>
137-
/// Occurs when a connection was closed.
138-
/// </summary>
106+
/// <inheritdoc />
139107
public event EventHandler<NetMQMonitorSocketEventArgs>? Closed;
140108

141-
/// <summary>
142-
/// Occurs when a connection couldn't be closed.
143-
/// </summary>
109+
/// <inheritdoc />
144110
public event EventHandler<NetMQMonitorErrorEventArgs>? CloseFailed;
145111

146-
/// <summary>
147-
/// Occurs when the stream engine (TCP and IPC specific) detects a corrupted / broken session.
148-
/// </summary>
112+
/// <inheritdoc />
149113
public event EventHandler<NetMQMonitorSocketEventArgs>? Disconnected;
150114

151115
#endregion
@@ -219,13 +183,7 @@ private void InternalClose()
219183
}
220184
}
221185

222-
/// <summary>
223-
/// Add the monitor object to a NetMQPoller, register to <see cref="EventReceived"/> to be signalled on new events
224-
/// </summary>
225-
/// <param name="poller"></param>
226-
/// <typeparam name="T"></typeparam>
227-
/// <exception cref="ArgumentNullException"></exception>
228-
/// <exception cref="InvalidOperationException"></exception>
186+
/// <inheritdoc />
229187
public void AttachToPoller<T>(T poller) where T : INetMQPoller
230188
{
231189
if (poller == null)
@@ -239,9 +197,7 @@ public void AttachToPoller<T>(T poller) where T : INetMQPoller
239197
poller.Add(m_monitoringSocket);
240198
}
241199

242-
/// <summary>
243-
/// Remove the monitor object from attached poller
244-
/// </summary>
200+
/// <inheritdoc />
245201
public void DetachFromPoller()
246202
{
247203
DetachFromPoller(false);
@@ -260,10 +216,7 @@ private void DetachFromPoller(bool dispose)
260216
InternalClose();
261217
}
262218

263-
/// <summary>
264-
/// Start monitor the socket, the method doesn't start a new thread and will block until the monitor poll is stopped
265-
/// </summary>
266-
/// <exception cref="InvalidOperationException">The Monitor must not have already started nor attached to a poller.</exception>
219+
/// <inheritdoc />
267220
public void Start()
268221
{
269222
if (IsRunning)
@@ -287,10 +240,7 @@ public void Start()
287240
}
288241
}
289242

290-
/// <summary>
291-
/// Start a background task for the monitoring operation.
292-
/// </summary>
293-
/// <returns></returns>
243+
/// <inheritdoc />
294244
public Task StartAsync()
295245
{
296246
if (IsRunning)
@@ -302,10 +252,7 @@ public Task StartAsync()
302252
return Task.Factory.StartNew(Start);
303253
}
304254

305-
/// <summary>
306-
/// Stop monitoring. Blocks until monitoring completed.
307-
/// </summary>
308-
/// <exception cref="InvalidOperationException">If this monitor is attached to a poller you must detach it first and not use the stop method.</exception>
255+
/// <inheritdoc />
309256
public void Stop()
310257
{
311258
if (m_attachedPoller != null)

0 commit comments

Comments
 (0)