Search in sources :

Example 36 with CloseWebSocketFrame

use of io.netty.handler.codec.http.websocketx.CloseWebSocketFrame in project reactor-netty by reactor.

the class WebsocketTest method testCloseWebSocketFrameSentByClient.

@Test
void testCloseWebSocketFrameSentByClient() {
    disposableServer = createServer().handle((req, res) -> res.sendWebsocket((in, out) -> out.sendString(Mono.just("echo")).sendObject(new CloseWebSocketFrame()))).bindNow();
    Mono<Void> response = createClient(disposableServer.port()).websocket().uri("/").handle((in, out) -> out.sendObject(in.receiveFrames().doOnNext(WebSocketFrame::retain).then())).next();
    StepVerifier.create(response).expectComplete().verify(Duration.ofSeconds(30));
}
Also used : StepVerifier(reactor.test.StepVerifier) AbortedException(reactor.netty.channel.AbortedException) BiFunction(java.util.function.BiFunction) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseHttpTest(reactor.netty.BaseHttpTest) Unpooled(io.netty.buffer.Unpooled) WebsocketOutbound(reactor.netty.http.websocket.WebsocketOutbound) ConnectionObserver(reactor.netty.ConnectionObserver) Loggers(reactor.util.Loggers) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Logger(reactor.util.Logger) URI(java.net.URI) Predicate(java.util.function.Predicate) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) WebSocketClientHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) WebSocketCloseStatus(io.netty.handler.codec.http.websocketx.WebSocketCloseStatus) Tuple2(reactor.util.function.Tuple2) WebSocketHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketHandshakeException) Scheduler(reactor.core.scheduler.Scheduler) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Nullable(reactor.util.annotation.Nullable) ArrayList(java.util.ArrayList) WebsocketServerSpec(reactor.netty.http.server.WebsocketServerSpec) Charset(java.nio.charset.Charset) PongWebSocketFrame(io.netty.handler.codec.http.websocketx.PongWebSocketFrame) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ClientCookieEncoder(io.netty.handler.codec.http.cookie.ClientCookieEncoder) Schedulers(reactor.core.scheduler.Schedulers) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) Connection(reactor.netty.Connection) WebSocketFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) PingWebSocketFrame(io.netty.handler.codec.http.websocketx.PingWebSocketFrame) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Flux(reactor.core.publisher.Flux) WebsocketInbound(reactor.netty.http.websocket.WebsocketInbound) TextWebSocketFrame(io.netty.handler.codec.http.websocketx.TextWebSocketFrame) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) ConnectionProvider(reactor.netty.resources.ConnectionProvider) CorruptedFrameException(io.netty.handler.codec.CorruptedFrameException) ClientCookieDecoder(io.netty.handler.codec.http.cookie.ClientCookieDecoder) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) PongWebSocketFrame(io.netty.handler.codec.http.websocketx.PongWebSocketFrame) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) WebSocketFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame) PingWebSocketFrame(io.netty.handler.codec.http.websocketx.PingWebSocketFrame) TextWebSocketFrame(io.netty.handler.codec.http.websocketx.TextWebSocketFrame) BaseHttpTest(reactor.netty.BaseHttpTest) Test(org.junit.jupiter.api.Test)

Example 37 with CloseWebSocketFrame

use of io.netty.handler.codec.http.websocketx.CloseWebSocketFrame in project reactor-netty by reactor.

the class WebsocketTest method testIssue900_2.

@Test
void testIssue900_2() throws Exception {
    AtomicReference<WebSocketCloseStatus> statusServer = new AtomicReference<>();
    AtomicReference<String> incomingData = new AtomicReference<>();
    CountDownLatch latch = new CountDownLatch(1);
    disposableServer = createServer().handle((req, res) -> res.sendWebsocket((in, out) -> {
        in.receiveCloseStatus().doOnNext(o -> {
            statusServer.set(o);
            latch.countDown();
        }).subscribe();
        return out.sendObject(Flux.just(new TextWebSocketFrame("echo"), new CloseWebSocketFrame(1008, "something")).delayElements(Duration.ofMillis(100))).then(in.receiveFrames().doOnNext(o -> {
            if (o instanceof TextWebSocketFrame) {
                incomingData.set(((TextWebSocketFrame) o).text());
            }
        }).then());
    })).bindNow();
    createClient(disposableServer.port()).websocket().uri("/").handle((in, out) -> out.sendObject(in.receiveFrames().doOnNext(WebSocketFrame::retain))).subscribe();
    assertThat(latch.await(30, TimeUnit.SECONDS)).isTrue();
    assertThat(incomingData.get()).isNotNull().isEqualTo("echo");
    assertThat(statusServer.get()).isNotNull().isEqualTo(new WebSocketCloseStatus(1008, "something"));
}
Also used : StepVerifier(reactor.test.StepVerifier) AbortedException(reactor.netty.channel.AbortedException) BiFunction(java.util.function.BiFunction) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseHttpTest(reactor.netty.BaseHttpTest) Unpooled(io.netty.buffer.Unpooled) WebsocketOutbound(reactor.netty.http.websocket.WebsocketOutbound) ConnectionObserver(reactor.netty.ConnectionObserver) Loggers(reactor.util.Loggers) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Logger(reactor.util.Logger) URI(java.net.URI) Predicate(java.util.function.Predicate) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) WebSocketClientHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) WebSocketCloseStatus(io.netty.handler.codec.http.websocketx.WebSocketCloseStatus) Tuple2(reactor.util.function.Tuple2) WebSocketHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketHandshakeException) Scheduler(reactor.core.scheduler.Scheduler) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Nullable(reactor.util.annotation.Nullable) ArrayList(java.util.ArrayList) WebsocketServerSpec(reactor.netty.http.server.WebsocketServerSpec) Charset(java.nio.charset.Charset) PongWebSocketFrame(io.netty.handler.codec.http.websocketx.PongWebSocketFrame) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ClientCookieEncoder(io.netty.handler.codec.http.cookie.ClientCookieEncoder) Schedulers(reactor.core.scheduler.Schedulers) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) Connection(reactor.netty.Connection) WebSocketFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) PingWebSocketFrame(io.netty.handler.codec.http.websocketx.PingWebSocketFrame) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Flux(reactor.core.publisher.Flux) WebsocketInbound(reactor.netty.http.websocket.WebsocketInbound) TextWebSocketFrame(io.netty.handler.codec.http.websocketx.TextWebSocketFrame) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) ConnectionProvider(reactor.netty.resources.ConnectionProvider) CorruptedFrameException(io.netty.handler.codec.CorruptedFrameException) ClientCookieDecoder(io.netty.handler.codec.http.cookie.ClientCookieDecoder) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) WebSocketCloseStatus(io.netty.handler.codec.http.websocketx.WebSocketCloseStatus) TextWebSocketFrame(io.netty.handler.codec.http.websocketx.TextWebSocketFrame) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) BaseHttpTest(reactor.netty.BaseHttpTest) Test(org.junit.jupiter.api.Test)

Example 38 with CloseWebSocketFrame

use of io.netty.handler.codec.http.websocketx.CloseWebSocketFrame in project reactor-netty by reactor.

the class WebsocketTest method testIssue663_3.

@Test
void testIssue663_3() throws Exception {
    AtomicBoolean incomingData = new AtomicBoolean();
    CountDownLatch latch = new CountDownLatch(1);
    disposableServer = createServer().handle((req, resp) -> resp.sendWebsocket((i, o) -> i.receiveFrames().then())).bindNow();
    createClient(disposableServer.port()).websocket().uri("/").handle((in, out) -> out.sendObject(Flux.just(new PingWebSocketFrame(), new CloseWebSocketFrame()).delayElements(Duration.ofMillis(100))).then(in.receiveFrames().doOnNext(f -> {
        if (f instanceof PongWebSocketFrame) {
            incomingData.set(true);
        }
    }).doOnComplete(latch::countDown).then())).subscribe();
    assertThat(latch.await(30, TimeUnit.SECONDS)).isTrue();
    assertThat(incomingData.get()).isTrue();
}
Also used : StepVerifier(reactor.test.StepVerifier) AbortedException(reactor.netty.channel.AbortedException) BiFunction(java.util.function.BiFunction) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseHttpTest(reactor.netty.BaseHttpTest) Unpooled(io.netty.buffer.Unpooled) WebsocketOutbound(reactor.netty.http.websocket.WebsocketOutbound) ConnectionObserver(reactor.netty.ConnectionObserver) Loggers(reactor.util.Loggers) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Logger(reactor.util.Logger) URI(java.net.URI) Predicate(java.util.function.Predicate) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) WebSocketClientHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) WebSocketCloseStatus(io.netty.handler.codec.http.websocketx.WebSocketCloseStatus) Tuple2(reactor.util.function.Tuple2) WebSocketHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketHandshakeException) Scheduler(reactor.core.scheduler.Scheduler) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Nullable(reactor.util.annotation.Nullable) ArrayList(java.util.ArrayList) WebsocketServerSpec(reactor.netty.http.server.WebsocketServerSpec) Charset(java.nio.charset.Charset) PongWebSocketFrame(io.netty.handler.codec.http.websocketx.PongWebSocketFrame) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ClientCookieEncoder(io.netty.handler.codec.http.cookie.ClientCookieEncoder) Schedulers(reactor.core.scheduler.Schedulers) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) Connection(reactor.netty.Connection) WebSocketFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) PingWebSocketFrame(io.netty.handler.codec.http.websocketx.PingWebSocketFrame) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Flux(reactor.core.publisher.Flux) WebsocketInbound(reactor.netty.http.websocket.WebsocketInbound) TextWebSocketFrame(io.netty.handler.codec.http.websocketx.TextWebSocketFrame) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) ConnectionProvider(reactor.netty.resources.ConnectionProvider) CorruptedFrameException(io.netty.handler.codec.CorruptedFrameException) ClientCookieDecoder(io.netty.handler.codec.http.cookie.ClientCookieDecoder) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) PongWebSocketFrame(io.netty.handler.codec.http.websocketx.PongWebSocketFrame) CountDownLatch(java.util.concurrent.CountDownLatch) PingWebSocketFrame(io.netty.handler.codec.http.websocketx.PingWebSocketFrame) BaseHttpTest(reactor.netty.BaseHttpTest) Test(org.junit.jupiter.api.Test)

Example 39 with CloseWebSocketFrame

use of io.netty.handler.codec.http.websocketx.CloseWebSocketFrame in project reactor-netty by reactor.

the class WebsocketTest method testIssue1485_CloseFrameSentByServer.

@Test
void testIssue1485_CloseFrameSentByServer() throws Exception {
    AtomicReference<WebSocketCloseStatus> statusServer = new AtomicReference<>();
    AtomicReference<WebSocketCloseStatus> statusClient = new AtomicReference<>();
    CountDownLatch latch = new CountDownLatch(2);
    disposableServer = createServer().handle((req, res) -> res.sendWebsocket((in, out) -> {
        in.receiveCloseStatus().doOnNext(status -> {
            statusServer.set(status);
            latch.countDown();
        }).subscribe();
        return out.sendObject(new CloseWebSocketFrame()).then(in.receive().then());
    })).bindNow();
    createClient(disposableServer.port()).websocket().uri("/").handle((in, out) -> {
        in.receiveCloseStatus().doOnNext(status -> {
            statusClient.set(status);
            latch.countDown();
        }).subscribe();
        return in.receive();
    }).blockLast(Duration.ofSeconds(5));
    assertThat(latch.await(5, TimeUnit.SECONDS)).isTrue();
    assertThat(statusClient.get()).isNotNull().isEqualTo(WebSocketCloseStatus.EMPTY);
    assertThat(statusServer.get()).isNotNull().isEqualTo(WebSocketCloseStatus.EMPTY);
}
Also used : StepVerifier(reactor.test.StepVerifier) AbortedException(reactor.netty.channel.AbortedException) BiFunction(java.util.function.BiFunction) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseHttpTest(reactor.netty.BaseHttpTest) Unpooled(io.netty.buffer.Unpooled) WebsocketOutbound(reactor.netty.http.websocket.WebsocketOutbound) ConnectionObserver(reactor.netty.ConnectionObserver) Loggers(reactor.util.Loggers) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Logger(reactor.util.Logger) URI(java.net.URI) Predicate(java.util.function.Predicate) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) WebSocketClientHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) WebSocketCloseStatus(io.netty.handler.codec.http.websocketx.WebSocketCloseStatus) Tuple2(reactor.util.function.Tuple2) WebSocketHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketHandshakeException) Scheduler(reactor.core.scheduler.Scheduler) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Nullable(reactor.util.annotation.Nullable) ArrayList(java.util.ArrayList) WebsocketServerSpec(reactor.netty.http.server.WebsocketServerSpec) Charset(java.nio.charset.Charset) PongWebSocketFrame(io.netty.handler.codec.http.websocketx.PongWebSocketFrame) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ClientCookieEncoder(io.netty.handler.codec.http.cookie.ClientCookieEncoder) Schedulers(reactor.core.scheduler.Schedulers) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) Connection(reactor.netty.Connection) WebSocketFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) PingWebSocketFrame(io.netty.handler.codec.http.websocketx.PingWebSocketFrame) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Flux(reactor.core.publisher.Flux) WebsocketInbound(reactor.netty.http.websocket.WebsocketInbound) TextWebSocketFrame(io.netty.handler.codec.http.websocketx.TextWebSocketFrame) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) ConnectionProvider(reactor.netty.resources.ConnectionProvider) CorruptedFrameException(io.netty.handler.codec.CorruptedFrameException) ClientCookieDecoder(io.netty.handler.codec.http.cookie.ClientCookieDecoder) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) WebSocketCloseStatus(io.netty.handler.codec.http.websocketx.WebSocketCloseStatus) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) BaseHttpTest(reactor.netty.BaseHttpTest) Test(org.junit.jupiter.api.Test)

Example 40 with CloseWebSocketFrame

use of io.netty.handler.codec.http.websocketx.CloseWebSocketFrame in project reactor-netty by reactor.

the class WebsocketTest method testIssue663_4.

@Test
void testIssue663_4() throws Exception {
    AtomicBoolean incomingData = new AtomicBoolean();
    CountDownLatch latch = new CountDownLatch(1);
    disposableServer = createServer().handle((req, resp) -> resp.sendWebsocket((i, o) -> i.receiveFrames().then(), WebsocketServerSpec.builder().handlePing(true).build())).bindNow();
    createClient(disposableServer.port()).websocket().uri("/").handle((in, out) -> out.sendObject(Flux.just(new PingWebSocketFrame(), new CloseWebSocketFrame()).delayElements(Duration.ofMillis(100))).then(in.receiveFrames().doOnNext(f -> incomingData.set(true)).doOnComplete(latch::countDown).then())).subscribe();
    assertThat(latch.await(30, TimeUnit.SECONDS)).isTrue();
    assertThat(incomingData.get()).isFalse();
}
Also used : StepVerifier(reactor.test.StepVerifier) AbortedException(reactor.netty.channel.AbortedException) BiFunction(java.util.function.BiFunction) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseHttpTest(reactor.netty.BaseHttpTest) Unpooled(io.netty.buffer.Unpooled) WebsocketOutbound(reactor.netty.http.websocket.WebsocketOutbound) ConnectionObserver(reactor.netty.ConnectionObserver) Loggers(reactor.util.Loggers) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Logger(reactor.util.Logger) URI(java.net.URI) Predicate(java.util.function.Predicate) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) WebSocketClientHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) WebSocketCloseStatus(io.netty.handler.codec.http.websocketx.WebSocketCloseStatus) Tuple2(reactor.util.function.Tuple2) WebSocketHandshakeException(io.netty.handler.codec.http.websocketx.WebSocketHandshakeException) Scheduler(reactor.core.scheduler.Scheduler) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Nullable(reactor.util.annotation.Nullable) ArrayList(java.util.ArrayList) WebsocketServerSpec(reactor.netty.http.server.WebsocketServerSpec) Charset(java.nio.charset.Charset) PongWebSocketFrame(io.netty.handler.codec.http.websocketx.PongWebSocketFrame) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ClientCookieEncoder(io.netty.handler.codec.http.cookie.ClientCookieEncoder) Schedulers(reactor.core.scheduler.Schedulers) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) Connection(reactor.netty.Connection) WebSocketFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) PingWebSocketFrame(io.netty.handler.codec.http.websocketx.PingWebSocketFrame) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Flux(reactor.core.publisher.Flux) WebsocketInbound(reactor.netty.http.websocket.WebsocketInbound) TextWebSocketFrame(io.netty.handler.codec.http.websocketx.TextWebSocketFrame) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) ConnectionProvider(reactor.netty.resources.ConnectionProvider) CorruptedFrameException(io.netty.handler.codec.CorruptedFrameException) ClientCookieDecoder(io.netty.handler.codec.http.cookie.ClientCookieDecoder) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CountDownLatch(java.util.concurrent.CountDownLatch) PingWebSocketFrame(io.netty.handler.codec.http.websocketx.PingWebSocketFrame) BaseHttpTest(reactor.netty.BaseHttpTest) Test(org.junit.jupiter.api.Test)

Aggregations

CloseWebSocketFrame (io.netty.handler.codec.http.websocketx.CloseWebSocketFrame)41 PingWebSocketFrame (io.netty.handler.codec.http.websocketx.PingWebSocketFrame)23 TextWebSocketFrame (io.netty.handler.codec.http.websocketx.TextWebSocketFrame)23 PongWebSocketFrame (io.netty.handler.codec.http.websocketx.PongWebSocketFrame)22 WebSocketFrame (io.netty.handler.codec.http.websocketx.WebSocketFrame)17 URI (java.net.URI)13 CountDownLatch (java.util.concurrent.CountDownLatch)13 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)13 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)12 AtomicReference (java.util.concurrent.atomic.AtomicReference)12 WebSocketHandshakeException (io.netty.handler.codec.http.websocketx.WebSocketHandshakeException)11 Test (org.junit.jupiter.api.Test)11 EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)10 HttpHeaderNames (io.netty.handler.codec.http.HttpHeaderNames)10 WebSocketClientHandshakeException (io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException)10 TimeUnit (java.util.concurrent.TimeUnit)10 Consumer (java.util.function.Consumer)10 Function (java.util.function.Function)10 Unpooled (io.netty.buffer.Unpooled)9 CorruptedFrameException (io.netty.handler.codec.CorruptedFrameException)9