initial fixing

This commit is contained in:
Erik Frojdh
2020-02-04 17:34:07 +01:00
parent 94fcf52e64
commit 8f64449117
3 changed files with 84 additions and 1 deletions

View File

@ -18,4 +18,18 @@ target_link_libraries(result
set_target_properties(result PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
)
add_executable(udp udp.cpp)
target_link_libraries(udp
slsDetectorShared
slsSupportLib
pthread
rt
)
set_target_properties(udp PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

13
sample/udp.cpp Normal file
View File

@ -0,0 +1,13 @@
#include "UdpSocket.h"
#include <iostream>
#include <chrono>
#include <thread>
int main(){
std::cout << "HEJ\n";
sls::UdpSocket s(50010, 1024);
while(true){
std::cout << "Got: " << s.ReceivePacket() << " bytes\n";
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
}