Skip to content

Instantly share code, notes, and snippets.

View A4213001's full-sized avatar

郭先旻 A4213001

View GitHub Profile
@A4213001
A4213001 / WsChatServlet.java
Created July 24, 2018 08:23 — forked from chitan/WsChatServlet.java
How to use WebSocket of Tomcat
//This sample is how to use websocket of Tomcat.
package wsapp;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.util.ArrayList;
import org.apache.catalina.websocket.MessageInbound;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;