• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lextudio / sharpsnmplib / 11823966615

13 Nov 2024 06:58PM UTC coverage: 49.626% (-3.4%) from 53.042%
11823966615

push

github

lextm
Removed .NET 6.

819 of 1881 branches covered (43.54%)

Branch coverage included in aggregate %.

2232 of 4267 relevant lines covered (52.31%)

15136.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/SharpSnmpLib/Messaging/EndPointExtension.cs
1
// EndPoint extension class.
2
// Copyright (C) 2008-2010 Malcolm Crowe, Lex Li, and other contributors.
3
// 
4
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
5
// software and associated documentation files (the "Software"), to deal in the Software
6
// without restriction, including without limitation the rights to use, copy, modify, merge,
7
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
8
// to whom the Software is furnished to do so, subject to the following conditions:
9
// 
10
// The above copyright notice and this permission notice shall be included in all copies or
11
// substantial portions of the Software.
12
// 
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
15
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
16
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
17
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
// DEALINGS IN THE SOFTWARE.
19

20
using System;
21
using System.Net;
22
using System.Net.Sockets;
23

24
namespace Lextm.SharpSnmpLib.Messaging
25
{
26
    /// <summary>
27
    /// Extension methods for <see cref="EndPoint"/>.
28
    /// </summary>
29
    public static class EndPointExtension
30
    {
31
        /// <summary>
32
        /// Gets the socket.
33
        /// </summary>
34
        /// <param name="endpoint">The endpoint.</param>
35
        /// <returns></returns>
36
        public static Socket GetSocket(this EndPoint endpoint)
37
        {
38
            if (endpoint == null)
×
39
            {
40
                throw new ArgumentNullException(nameof(endpoint));
×
41
            }
42

43
            var result = new Socket(endpoint.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
×
44
            return result;
×
45
        }
46
    }
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc