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

randombit / botan / 13429216726

20 Feb 2025 06:22AM UTC coverage: 91.647% (+0.003%) from 91.644%
13429216726

Pull #4660

github

web-flow
Merge b720e7b81 into a2981b3c6
Pull Request #4660: Consolidation and Enhancement of BSD Socket Layer

95032 of 103694 relevant lines covered (91.65%)

11432150.21 hits per line

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

83.33
/src/cli/socket_utils.h
1
/*
2
* (C) 2014,2017 Jack Lloyd
3
*     2017 René Korthaus, Rohde & Schwarz Cybersecurity
4
*     2025 Kagan Can Sit
5
*
6
* Botan is released under the Simplified BSD License (see license.txt)
7
*/
8

9
#ifndef BOTAN_CLI_SOCKET_UTILS_H_
10
#define BOTAN_CLI_SOCKET_UTILS_H_
11

12
#include "cli_exceptions.h"
13
#include <botan/internal/socket_platform.h>
14

15
class Socket_Utils {
16
   public:
17
      // Re-export platform types for CLI usage
18
      using socket_type = Botan::OS::Socket_Platform::socket_type;
19
      using socket_op_ret_type = Botan::OS::Socket_Platform::socket_op_ret_type;
20
      using socklen_type = Botan::OS::Socket_Platform::socklen_type;
21
      using sendrecv_len_type = Botan::OS::Socket_Platform::sendrecv_len_type;
22

23
      // Socket operations
24
      [[nodiscard]] static socket_type invalid_socket() noexcept {
13✔
25
         return Botan::OS::Socket_Platform::invalid_socket();
13✔
26
      }
27

28
      static void close_socket(socket_type s) noexcept { Botan::OS::Socket_Platform::close_socket(s); }
23✔
29

30
      [[nodiscard]] static std::string get_last_error() { return Botan::OS::Socket_Platform::get_last_socket_error(); }
×
31

32
      static void set_nonblocking(socket_type s) { Botan::OS::Socket_Platform::set_nonblocking(s); }
33

34
      // Socket initialization
35
      static void init() { Botan::OS::Socket_Platform::socket_init(); }
13✔
36

37
      static void cleanup() noexcept { Botan::OS::Socket_Platform::socket_fini(); }
13✔
38

39
   private:
40
      Socket_Utils() = delete;  // Static class
41
      ~Socket_Utils() = delete;
42
};
43

44
#if !defined(MSG_NOSIGNAL)
45
   #define MSG_NOSIGNAL 0
46
#endif
47
#endif  // BOTAN_CLI_SOCKET_UTILS_H_
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

© 2026 Coveralls, Inc