• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java OnFrame类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.eclipse.jetty.websocket.WebSocket.OnFrame的典型用法代码示例。如果您正苦于以下问题:Java OnFrame类的具体用法?Java OnFrame怎么用?Java OnFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

OnFrame类属于org.eclipse.jetty.websocket.WebSocket包,在下文中一共展示了OnFrame类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: WebSocketConnectionRFC6455

点赞 2

import org.eclipse.jetty.websocket.WebSocket.OnFrame; //导入依赖的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

点赞 2

import org.eclipse.jetty.websocket.WebSocket.OnFrame; //导入依赖的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


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)