11using System ;
22using System . Net . Sockets ;
33using System . Runtime . Serialization ;
4-
5- #if ! NETSTANDARD1_6
64using System . Security . Permissions ;
7- #endif
8-
95using NetMQ . Core ;
106
117namespace NetMQ
128{
139 /// <summary>
1410 /// Base class for custom exceptions within the NetMQ library.
1511 /// </summary>
16- #if ! NETSTANDARD1_6
1712 [ Serializable ]
18- #endif
1913 public class NetMQException : Exception
2014 {
2115 /// <summary>
@@ -50,8 +44,6 @@ public NetMQException(string message, Exception innerException)
5044 : base ( message , innerException )
5145 { }
5246
53- #if ! NETSTANDARD1_6
54-
5547 /// <summary>Constructor for serialisation.</summary>
5648 protected NetMQException ( SerializationInfo info , StreamingContext context )
5749 : base ( info , context )
@@ -67,8 +59,6 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
6759 base . GetObjectData ( info , context ) ;
6860 }
6961
70- #endif
71-
7262 #endregion
7363
7464 /// <summary>
@@ -182,9 +172,7 @@ private static NetMQException Create(ErrorCode errorCode, string? message, Excep
182172 /// <summary>
183173 /// AddressAlreadyInUseException is a NetMQException that is used within SocketBase.Bind to signal an address-conflict.
184174 /// </summary>
185- #if ! NETSTANDARD1_6
186175 [ Serializable ]
187- #endif
188176 public class AddressAlreadyInUseException : NetMQException
189177 {
190178 /// <summary>
@@ -206,21 +194,17 @@ public AddressAlreadyInUseException(string? message)
206194 {
207195 }
208196
209- #if ! NETSTANDARD1_6
210197 /// <summary>Constructor for serialisation.</summary>
211198 protected AddressAlreadyInUseException ( SerializationInfo info , StreamingContext context )
212199 : base ( info , context )
213200 {
214201 }
215- #endif
216202 }
217203
218204 /// <summary>
219205 /// EndpointNotFoundException is a NetMQException that is used within Ctx.FindEndpoint to signal a failure to find a specified address.
220206 /// </summary>
221- #if ! NETSTANDARD1_6
222207 [ Serializable ]
223- #endif
224208 public class EndpointNotFoundException : NetMQException
225209 {
226210 /// <summary>
@@ -250,22 +234,18 @@ public EndpointNotFoundException()
250234 {
251235 }
252236
253- #if ! NETSTANDARD1_6
254237 /// <summary>Constructor for serialisation.</summary>
255238 protected EndpointNotFoundException ( SerializationInfo info , StreamingContext context )
256239 : base ( info , context )
257240 {
258241 }
259- #endif
260242 }
261243
262244 /// <summary>
263245 /// TerminatingException is a NetMQException that is used within SocketBase and Ctx to signal
264246 /// that you're making the mistake of trying to do further work after terminating the message-queueing system.
265247 /// </summary>
266- #if ! NETSTANDARD1_6
267248 [ Serializable ]
268- #endif
269249 public class TerminatingException : NetMQException
270250 {
271251 /// <summary>
@@ -294,21 +274,18 @@ internal TerminatingException()
294274 : this ( null , null )
295275 {
296276 }
297- #if ! NETSTANDARD1_6
277+
298278 /// <summary>Constructor for serialisation.</summary>
299279 protected TerminatingException ( SerializationInfo info , StreamingContext context )
300280 : base ( info , context )
301281 {
302282 }
303- #endif
304283 }
305284
306285 /// <summary>
307286 /// InvalidException is a NetMQException that is used within the message-queueing system to signal invalid value errors.
308287 /// </summary>
309- #if ! NETSTANDARD1_6
310288 [ Serializable ]
311- #endif
312289 public class InvalidException : NetMQException
313290 {
314291 /// <summary>
@@ -337,21 +314,18 @@ public InvalidException()
337314 : this ( null , null )
338315 {
339316 }
340- #if ! NETSTANDARD1_6
317+
341318 /// <summary>Constructor for serialisation.</summary>
342319 protected InvalidException ( SerializationInfo info , StreamingContext context )
343320 : base ( info , context )
344321 {
345322 }
346- #endif
347323 }
348324
349325 /// <summary>
350326 /// FaultException is a NetMQException that is used within the message-queueing system to signal general fault conditions.
351327 /// </summary>
352- #if ! NETSTANDARD1_6
353328 [ Serializable ]
354- #endif
355329 public class FaultException : NetMQException
356330 {
357331 /// <summary>
@@ -380,22 +354,19 @@ public FaultException()
380354 : this ( null , null )
381355 {
382356 }
383- #if ! NETSTANDARD1_6
357+
384358 /// <summary>Constructor for serialisation.</summary>
385359 protected FaultException ( SerializationInfo info , StreamingContext context )
386360 : base ( info , context )
387361 {
388362 }
389- #endif
390363 }
391364
392365 /// <summary>
393366 /// ProtocolNotSupportedException is a NetMQException that is used within the message-queueing system to signal
394367 /// mistakes in properly utilizing the communications protocols.
395368 /// </summary>
396- #if ! NETSTANDARD1_6
397369 [ Serializable ]
398- #endif
399370 public class ProtocolNotSupportedException : NetMQException
400371 {
401372 /// <summary>
@@ -424,22 +395,19 @@ public ProtocolNotSupportedException()
424395 : this ( null , null )
425396 {
426397 }
427- #if ! NETSTANDARD1_6
398+
428399 /// <summary>Constructor for serialisation.</summary>
429400 protected ProtocolNotSupportedException ( SerializationInfo info , StreamingContext context )
430401 : base ( info , context )
431402 {
432403 }
433- #endif
434404 }
435405
436406 /// <summary>
437407 /// HostUnreachableException is an Exception that is used within the message-queueing system
438408 /// to signal failures to communicate with a host.
439409 /// </summary>
440- #if ! NETSTANDARD1_6
441410 [ Serializable ]
442- #endif
443411 public class HostUnreachableException : NetMQException
444412 {
445413 /// <summary>
@@ -468,22 +436,19 @@ public HostUnreachableException()
468436 : this ( null , null )
469437 {
470438 }
471- #if ! NETSTANDARD1_6
439+
472440 /// <summary>Constructor for serialisation.</summary>
473441 protected HostUnreachableException ( SerializationInfo info , StreamingContext context )
474442 : base ( info , context )
475443 {
476444 }
477- #endif
478445 }
479446
480447 /// <summary>
481448 /// FiniteStateMachineException is an Exception that is used within the message-queueing system
482449 /// to signal errors in the send/receive order with request/response sockets.
483450 /// </summary>
484- #if ! NETSTANDARD1_6
485451 [ Serializable ]
486- #endif
487452 public class FiniteStateMachineException : NetMQException
488453 {
489454 /// <summary>
@@ -512,12 +477,11 @@ public FiniteStateMachineException()
512477 : this ( null , null )
513478 {
514479 }
515- #if ! NETSTANDARD1_6
480+
516481 /// <summary>Constructor for serialisation.</summary>
517482 protected FiniteStateMachineException ( SerializationInfo info , StreamingContext context )
518483 : base ( info , context )
519484 {
520485 }
521- #endif
522486 }
523487}
0 commit comments