Skip to content

Commit

Permalink
Tweaks to library
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebenezer-group committed Dec 16, 2024
1 parent f3b5db3 commit a5dc2ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD License

Copyright (c) 2016-2024, Brian Wood
Copyright (c) 2016-2025, Brian Wood
All rights reserved.
https://webEbenezer.net

Expand Down
5 changes: 3 additions & 2 deletions src/cmwBuffer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,8 @@ using FixedString120=FixedString<120>;

struct SockaddrWrapper{
::sockaddr_in sa;
SockaddrWrapper (char const* node,::uint16_t port):sa{AF_INET,::htons(port),{},{}}{
SockaddrWrapper (::uint16_t port):sa{AF_INET,::htons(port),{},{}}{}
SockaddrWrapper (char const* node,::uint16_t port):SockaddrWrapper(port){
if(int rc=::inet_pton(AF_INET,node,&sa.sin_addr);rc!=1)
raise("inet_pton",rc);
}
Expand All @@ -614,7 +615,7 @@ inline int preserveError (int s){

inline int udpServer (::uint16_t port){
int s=::socket(AF_INET,SOCK_DGRAM,0);
::sockaddr_in sa{AF_INET,::htons(port),{},{}};
SockaddrWrapper sa{port};
if(0==::bind(s,reinterpret_cast<::sockaddr*>(&sa),sizeof sa))return s;
raise("udpServer",preserveError(s));
}
Expand Down

0 comments on commit a5dc2ee

Please sign in to comment.