public class PubServer extends ReceiverAdapter
NioServer that accepts messages from clients (PubClient) and forwards them to
all connected clients| Modifier and Type | Field and Description |
|---|---|
protected Log |
log |
protected BaseServer |
server |
| Constructor and Description |
|---|
PubServer() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
help() |
static void |
main(String[] args) |
void |
receive(Address sender,
byte[] buf,
int offset,
int length)
Delivers a message from a given sender to the application
|
void |
receive(Address sender,
ByteBuffer buf)
The default implementation assumes that
Buffer.flip() or Buffer.rewind() was called on
buf before invoking this callback |
protected void |
start(InetAddress bind_addr,
int port,
boolean nio) |
protected BaseServer server
protected final Log log
protected void start(InetAddress bind_addr, int port, boolean nio) throws Exception
Exceptionpublic void receive(Address sender, ByteBuffer buf)
ReceiverAdapterBuffer.flip() or Buffer.rewind() was called on
buf before invoking this callbackreceive in interface Receiverreceive in class ReceiverAdaptersender - The sender of the messagebuf - The buffer. An application typically de-serializes data from the buffer into objects used by the
application. Note that when receive() returns, it is not safe to use the buffer any longer;
if an application needs to use a buffer after this callback returns, it must make a copy.
Note that buf could be a direct ByteBuffer.public void receive(Address sender, byte[] buf, int offset, int length)
Receiverreceive in interface Receiverreceive in class ReceiverAdaptersender - The sender of the messagebuf - The buffer. An application typically de-serializes data from the buffer into objects used by the
application. Note that when receive() returns, it is not safe to use the buffer any longer;
if an application needs to use a buffer after this callback returns, it must make a copy.offset - The offset at which the received data startslength - The length of the received dataprotected static void help()
Copyright © 2025 JBoss, a division of Red Hat. All rights reserved.