aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com/juick/server/tests/WebsocketClientHandler.java
blob: 7d896a04c3154707167f3b1cb67cf8feb44d0655 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package com.juick.server.tests;

import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;

import java.util.concurrent.CountDownLatch;

class WebsocketClientHandler extends TextWebSocketHandler {
    private final CountDownLatch latch;
    public WebsocketClientHandler(CountDownLatch latch) {
        this.latch = latch;
    }
    @Override
    public void afterConnectionEstablished(WebSocketSession session) throws Exception {
        super.afterConnectionEstablished(session);
        latch.countDown();
    }
}