Skip to content
Snippets Groups Projects
SimpleNetworkTest.cpp 735 B
Newer Older
  • Learn to ignore specific revisions
  • // SPDX-License-Identifier: LGPL-3.0-or-later
    // Copyright © 2020-2021 Florian Fischer
    #include <string>	 // for string, allocator
    #include <vector>	 // for vector
    
    #include "CountingPrivateSemaphore.hpp"	 // for CPS
    #include "emper.hpp"										 // for async, spawn
    #include "fixtures/network.hpp"					 // for echo_client, echo_serve
    #include "io.hpp"												 // for tcp_listener
    
    #define MAX 1024
    
    void emperTest() {
    
    	std::string port = "4242";
    	std::string addr = "127.0.0.1";
    
    
    	async(emper::io::tcp_listener(addr, port, echo_serve));
    
    			[&] {
    
    				const std::vector<std::string> strings = {"foo", "bar", std::string(MAX, 'a'), "quit\n"};
    
    				echo_client(addr, port, strings);