public class WebSocketHttpServer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected File |
contentRoot |
static Logger |
logger |
protected io.netty.util.AttributeKey<ClientSession> |
session |
| Constructor and Description |
|---|
WebSocketHttpServer(File contentRoot) |
| Modifier and Type | Method and Description |
|---|---|
protected ClientSession |
createNewSession() |
protected ClientSession |
getSession(io.netty.channel.ChannelHandlerContext ctx) |
boolean |
isAutoFlush() |
static void |
main(String[] args) |
void |
onBinaryMessage(io.netty.channel.ChannelHandlerContext ctx,
byte[] buffer) |
void |
onClose(io.netty.channel.ChannelHandlerContext ctx) |
void |
onHttpRequest(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
NettyWSHttpServer.HttpResponseSender sender) |
void |
onOpen(io.netty.channel.ChannelHandlerContext ctx) |
void |
onPong(io.netty.channel.ChannelHandlerContext ctx) |
void |
onTextMessage(io.netty.channel.ChannelHandlerContext ctx,
String text) |
void |
removeSession(io.netty.channel.ChannelHandlerContext ctx) |
void |
sendHttpGetResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
NettyWSHttpServer.HttpResponseSender sender,
String response) |
void |
sendWSBinaryMessage(io.netty.channel.ChannelHandlerContext ctx,
byte[] b) |
void |
sendWSBinaryMessage(io.netty.channel.ChannelHandlerContext ctx,
byte[] b,
int off,
int len) |
void |
sendWSPingMessage(io.netty.channel.ChannelHandlerContext ctx) |
void |
sendWSTextMessage(io.netty.channel.ChannelHandlerContext ctx,
String s) |
void |
serveFile(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
NettyWSHttpServer.HttpResponseSender sender) |
void |
setAutoFlush(boolean autoFlush)
if set to true, a flsh is triggered after each call to sendMessage.
|
protected final io.netty.util.AttributeKey<ClientSession> session
public static Logger logger
protected File contentRoot
public WebSocketHttpServer(File contentRoot)
public boolean isAutoFlush()
public void setAutoFlush(boolean autoFlush)
autoFlush - public void onOpen(io.netty.channel.ChannelHandlerContext ctx)
public void onClose(io.netty.channel.ChannelHandlerContext ctx)
public void onHttpRequest(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
NettyWSHttpServer.HttpResponseSender sender)
public void onTextMessage(io.netty.channel.ChannelHandlerContext ctx,
String text)
public void onBinaryMessage(io.netty.channel.ChannelHandlerContext ctx,
byte[] buffer)
public void onPong(io.netty.channel.ChannelHandlerContext ctx)
protected ClientSession getSession(io.netty.channel.ChannelHandlerContext ctx)
protected ClientSession createNewSession()
public void sendWSTextMessage(io.netty.channel.ChannelHandlerContext ctx,
String s)
public void sendWSBinaryMessage(io.netty.channel.ChannelHandlerContext ctx,
byte[] b,
int off,
int len)
public void sendWSPingMessage(io.netty.channel.ChannelHandlerContext ctx)
public void sendWSBinaryMessage(io.netty.channel.ChannelHandlerContext ctx,
byte[] b)
public void sendHttpGetResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
NettyWSHttpServer.HttpResponseSender sender,
String response)
public void serveFile(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
NettyWSHttpServer.HttpResponseSender sender)
public void removeSession(io.netty.channel.ChannelHandlerContext ctx)
Copyright © 2014. All rights reserved.