public class TcpParser extends Object implements io.vertx.core.Handler<io.vertx.core.buffer.Buffer>
| Modifier and Type | Field and Description |
|---|---|
static int |
TCP_HEADER_LENGTH |
static byte[] |
TCP_MAGIC |
| Constructor and Description |
|---|
TcpParser(TcpBufferHandler output) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
firstNEqual(byte[] a,
byte[] b,
int n) |
void |
handle(io.vertx.core.buffer.Buffer buf) |
protected void |
onParse(io.vertx.core.buffer.Buffer buffer) |
protected void |
reset()
在解析出错时,通过重新创建parser对象,将整个缓冲区重置
|
public static final byte[] TCP_MAGIC
public static final int TCP_HEADER_LENGTH
public TcpParser(TcpBufferHandler output)
protected void reset()
public boolean firstNEqual(byte[] a,
byte[] b,
int n)
protected void onParse(io.vertx.core.buffer.Buffer buffer)
public void handle(io.vertx.core.buffer.Buffer buf)
handle in interface io.vertx.core.Handler<io.vertx.core.buffer.Buffer>Copyright © 2017–2021 The Apache Software Foundation. All rights reserved.