本文整理汇总了Java中org.eclipse.jetty.websocket.WebSocket.OnTextMessage类的典型用法代码示例。如果您正苦于以下问题:Java OnTextMessage类的具体用法?Java OnTextMessage怎么用?Java OnTextMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OnTextMessage类属于org.eclipse.jetty.websocket.WebSocket包,在下文中一共展示了OnTextMessage类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: WebSocketConnectionRFC6455
import org.eclipse.jetty.websocket.WebSocket.OnTextMessage; //导入依赖的package包/类
public WebSocketConnectionRFC6455(WebSocket websocket, EndPoint endpoint, WebSocketBuffers buffers, long timestamp, int maxIdleTime, String protocol, List<Extension> extensions,int draft, MaskGen maskgen)
throws IOException
{
super(endpoint,timestamp);
_context=Thread.currentThread().getContextClassLoader();
_endp.setMaxIdleTime(maxIdleTime);
_webSocket = websocket;
_onFrame=_webSocket instanceof OnFrame ? (OnFrame)_webSocket : null;
_onTextMessage=_webSocket instanceof OnTextMessage ? (OnTextMessage)_webSocket : null;
_onBinaryMessage=_webSocket instanceof OnBinaryMessage ? (OnBinaryMessage)_webSocket : null;
_onControl=_webSocket instanceof OnControl ? (OnControl)_webSocket : null;
_generator = new WebSocketGeneratorRFC6455(buffers, _endp,maskgen);
_extensions=extensions;
WebSocketParser.FrameHandler frameHandler = new WSFrameHandler();
if (_extensions!=null)
{
int e=0;
for (Extension extension : _extensions)
{
extension.bind(
_connection,
e==extensions.size()-1? frameHandler :extensions.get(e+1),
e==0?_generator:extensions.get(e-1));
e++;
}
}
_outbound=(_extensions==null||_extensions.size()==0)?_generator:extensions.get(extensions.size()-1);
WebSocketParser.FrameHandler inbound = (_extensions == null || _extensions.size() == 0) ? frameHandler : extensions.get(0);
_parser = new WebSocketParserRFC6455(buffers, endpoint, inbound,maskgen==null);
_protocol=protocol;
}
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:40,代码来源:WebSocketConnectionRFC6455.java
示例2: WebSocketConnectionRFC6455
import org.eclipse.jetty.websocket.WebSocket.OnTextMessage; //导入依赖的package包/类
public WebSocketConnectionRFC6455(WebSocket websocket, EndPoint endpoint, WebSocketBuffers buffers, long timestamp, int maxIdleTime, String protocol, List<Extension> extensions,int draft, MaskGen maskgen)
throws IOException
{
super(endpoint,timestamp);
_context=Thread.currentThread().getContextClassLoader();
_draft=draft;
_endp.setMaxIdleTime(maxIdleTime);
_webSocket = websocket;
_onFrame=_webSocket instanceof OnFrame ? (OnFrame)_webSocket : null;
_onTextMessage=_webSocket instanceof OnTextMessage ? (OnTextMessage)_webSocket : null;
_onBinaryMessage=_webSocket instanceof OnBinaryMessage ? (OnBinaryMessage)_webSocket : null;
_onControl=_webSocket instanceof OnControl ? (OnControl)_webSocket : null;
_generator = new WebSocketGeneratorRFC6455(buffers, _endp,maskgen);
_extensions=extensions;
WebSocketParser.FrameHandler frameHandler = new WSFrameHandler();
if (_extensions!=null)
{
int e=0;
for (Extension extension : _extensions)
{
extension.bind(
_connection,
e==extensions.size()-1? frameHandler :extensions.get(e+1),
e==0?_generator:extensions.get(e-1));
e++;
}
}
_outbound=(_extensions==null||_extensions.size()==0)?_generator:extensions.get(extensions.size()-1);
WebSocketParser.FrameHandler inbound = (_extensions == null || _extensions.size() == 0) ? frameHandler : extensions.get(0);
_parser = new WebSocketParserRFC6455(buffers, endpoint, inbound,maskgen==null);
_protocol=protocol;
}
开发者ID:knowledgecode,项目名称:jetty-websocket-android,代码行数:41,代码来源:WebSocketConnectionRFC6455.java
注:本文中的org.eclipse.jetty.websocket.WebSocket.OnTextMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论