Stress a bit more of uSockets when fuzzing
This commit is contained in:
@@ -33,6 +33,7 @@ void test() {
|
|||||||
/* Open event here, you may access ws->getUserData() which points to a PerSocketData struct */
|
/* Open event here, you may access ws->getUserData() which points to a PerSocketData struct */
|
||||||
ws->getNativeHandle();
|
ws->getNativeHandle();
|
||||||
ws->getRemoteAddressAsText();
|
ws->getRemoteAddressAsText();
|
||||||
|
us_poll_ext((struct us_poll_t *) ws);
|
||||||
},
|
},
|
||||||
.message = [](auto *ws, std::string_view message, uWS::OpCode opCode) {
|
.message = [](auto *ws, std::string_view message, uWS::OpCode opCode) {
|
||||||
ws->send(message, opCode, true);
|
ws->send(message, opCode, true);
|
||||||
@@ -41,7 +42,10 @@ void test() {
|
|||||||
/* Check ws->getBufferedAmount() here */
|
/* Check ws->getBufferedAmount() here */
|
||||||
},
|
},
|
||||||
.ping = [](auto *ws) {
|
.ping = [](auto *ws) {
|
||||||
/* Not implemented yet */
|
/* We use this to trigger the async/wakeup feature */
|
||||||
|
uWS::Loop::get()->defer([]() {
|
||||||
|
/* Do nothing */
|
||||||
|
});
|
||||||
},
|
},
|
||||||
.pong = [](auto *ws) {
|
.pong = [](auto *ws) {
|
||||||
/* Not implemented yet */
|
/* Not implemented yet */
|
||||||
@@ -55,6 +59,8 @@ void test() {
|
|||||||
|
|
||||||
/* Here we want to stress the connect feature, since nothing else stresses it */
|
/* Here we want to stress the connect feature, since nothing else stresses it */
|
||||||
struct us_loop_t *loop = (struct us_loop_t *) uWS::Loop::get();
|
struct us_loop_t *loop = (struct us_loop_t *) uWS::Loop::get();
|
||||||
|
/* This function is stupid */
|
||||||
|
us_loop_iteration_number(loop);
|
||||||
struct us_socket_context_t *client_context = us_create_socket_context(0, loop, 0, {});
|
struct us_socket_context_t *client_context = us_create_socket_context(0, loop, 0, {});
|
||||||
client = us_socket_context_connect(0, client_context, "hostname", 5000, "localhost", 0, 0);
|
client = us_socket_context_connect(0, client_context, "hostname", 5000, "localhost", 0, 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user