Skip to content

Commit

Permalink
Change to udpServer in library
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebenezer-group committed Jun 30, 2024
1 parent 64d05ab commit 7f4a6af
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/poly/receivePoly.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include<iostream>

int main ()try{
::cmw::BufferStack<::cmw::SameFormat> buf(::cmw::udpServer("13579"));
::cmw::BufferStack<::cmw::SameFormat> buf(::cmw::udpServer(13579));

for(;;){
buf.getPacket();
Expand Down
2 changes: 1 addition & 1 deletion example/receiveExample.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

int main ()try{
::cmw::winStart();
::cmw::BufferStack<::cmw::SameFormat> buf(::cmw::udpServer("12345"));
::cmw::BufferStack<::cmw::SameFormat> buf(::cmw::udpServer(12345));

for(;;){
buf.getPacket();
Expand Down
4 changes: 2 additions & 2 deletions src/cmwBuffer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,9 @@ struct SockaddrWrapper{
}
};

inline auto udpServer (char const* port){
inline auto udpServer (::uint16_t port){
auto s=::socket(AF_INET,SOCK_DGRAM,0);
SockaddrWrapper sa("127.0.0.1",fromChars(port));
SockaddrWrapper sa("127.0.0.1",port);
if(0==::bind(s,(sockaddr*)&sa,sizeof(sa)))return s;
raise("udpServer",preserveError(s));
}
Expand Down
2 changes: 1 addition & 1 deletion src/tiers/cmwA.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ int main (int ac,char** av)try{
}

checkField("UDP-port-number",cfg.getline(' '));
BufferStack<SameFormat> frntBuf{udpServer(cfg.getline().data())};
BufferStack<SameFormat> frntBuf{udpServer(fromChars(cfg.getline().data()))};
ioUring ring{frntBuf.sock_};
::io_uring_cqe* cq=0;
::std::deque<cmwRequest> pendingRequests;
Expand Down

0 comments on commit 7f4a6af

Please sign in to comment.