|
51 | 51 | tc_stream_client_send_binary/1,
|
52 | 52 | tc_stream_client_send_iolist/1,
|
53 | 53 | tc_stream_client_async_send/1,
|
| 54 | + tc_stream_client_send_seq/1, |
54 | 55 |
|
55 | 56 | tc_stream_passive_receive/1,
|
56 | 57 | tc_stream_passive_receive_shutdown/1,
|
@@ -397,6 +398,36 @@ tc_stream_client_send_binary(Config) ->
|
397 | 398 | ct:fail("timeout")
|
398 | 399 | end.
|
399 | 400 |
|
| 401 | +tc_stream_client_send_seq(Config) -> |
| 402 | + Port = select_port(), |
| 403 | + Owner = self(), |
| 404 | + {SPid, Ref} = spawn_monitor(fun() -> echo_server(Owner, Config, Port) end), |
| 405 | + receive |
| 406 | + listener_ready -> |
| 407 | + {ok, Conn} = quicer:connect("localhost", Port, default_conn_opts(), 5000), |
| 408 | + {ok, Stm} = quicer:start_stream(Conn, []), |
| 409 | + {ok, 1} = quicer:send(Stm, <<16>>), |
| 410 | + Payload = list_to_binary(lists:seq(2, 30)), |
| 411 | + Len = byte_size(Payload), |
| 412 | + {ok, 33} = quicer:send(Stm, <<Len:32, Payload/binary>>), |
| 413 | + flush_streams_available(Conn), |
| 414 | + flush_datagram_state_changed(Conn), |
| 415 | + receive |
| 416 | + {quic, <<16, Len:32, _/binary>>, _, _} -> |
| 417 | + ok = quicer:close_stream(Stm), |
| 418 | + ok = quicer:close_connection(Conn); |
| 419 | + {quic, <<16>>, _, _} -> |
| 420 | + ok = quicer:close_stream(Stm), |
| 421 | + ok = quicer:close_connection(Conn); |
| 422 | + Other -> |
| 423 | + ct:fail("Unexpected Msg ~p", [Other]) |
| 424 | + end, |
| 425 | + SPid ! done, |
| 426 | + ok = ensure_server_exit_normal(Ref) |
| 427 | + after 1000 -> |
| 428 | + ct:fail("timeout") |
| 429 | + end. |
| 430 | + |
400 | 431 | tc_stream_client_send_iolist(Config) ->
|
401 | 432 | Port = 4569,
|
402 | 433 | Owner = self(),
|
|
0 commit comments