Search in sources :

Example 11 with Buffer

use of org.glassfish.grizzly.Buffer in project Payara by payara.

the class WSTCPProtocolFinder method find.

@Override
public Result find(final PUContext puContext, final FilterChainContext filterChainContext) {
    final Buffer buffer = filterChainContext.getMessage();
    if (buffer.remaining() < PROTOCOL_SCHEMA_BYTES.length) {
        return Result.NEED_MORE_DATA;
    }
    final int pos = buffer.position();
    for (int i = 0; i < PROTOCOL_SCHEMA_BYTES.length; i++) {
        if (buffer.get(pos + i) != PROTOCOL_SCHEMA_BYTES[i]) {
            return Result.NOT_FOUND;
        }
    }
    return Result.FOUND;
}
Also used : Buffer(org.glassfish.grizzly.Buffer)

Aggregations

Buffer (org.glassfish.grizzly.Buffer)11 IOException (java.io.IOException)4 ChannelBuffer (com.alibaba.dubbo.remoting.buffer.ChannelBuffer)2 DynamicChannelBuffer (com.alibaba.dubbo.remoting.buffer.DynamicChannelBuffer)2 ChannelBuffer (org.apache.dubbo.remoting.buffer.ChannelBuffer)2 DynamicChannelBuffer (org.apache.dubbo.remoting.buffer.DynamicChannelBuffer)2 Connection (org.glassfish.grizzly.Connection)2 Channel (com.alibaba.dubbo.remoting.Channel)1 RemoteRestAdminCommand (com.sun.enterprise.admin.remote.RemoteRestAdminCommand)1 GrizzlyProxy (com.sun.enterprise.v3.services.impl.GrizzlyProxy)1 File (java.io.File)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 InetSocketAddress (java.net.InetSocketAddress)1 ByteBuffer (java.nio.ByteBuffer)1 SocketChannel (java.nio.channels.SocketChannel)1 LoginException (javax.security.auth.login.LoginException)1 LifecycleException (org.apache.catalina.LifecycleException)1 Channel (org.apache.dubbo.remoting.Channel)1 PayloadFilesManager (org.glassfish.admin.payload.PayloadFilesManager)1 AdminCommand (org.glassfish.api.admin.AdminCommand)1