Dynamically set response size from terminal
This commit is contained in:
@@ -4,11 +4,17 @@ std::string buffer;
|
|||||||
|
|
||||||
//#define USE_SSL
|
//#define USE_SSL
|
||||||
|
|
||||||
int main() {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
buffer = "Hello world!";
|
// dynamically set respinse size from arguments
|
||||||
|
if (argc == 2) {
|
||||||
//buffer.resize(512);
|
int bytes = atoi(argv[1]);
|
||||||
|
std::cout << "Server going to respond with " << bytes << " bytes of data" << std::endl;
|
||||||
|
buffer.resize(bytes);
|
||||||
|
} else {
|
||||||
|
std::cout << "Usage: uWS_test bytesInResponse" << std::endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
//uWS::init();
|
//uWS::init();
|
||||||
//uWS::Loop loop();
|
//uWS::Loop loop();
|
||||||
|
|||||||
Reference in New Issue
Block a user