A debug option function. Called with each frame the client reads (">")
or writes ("<"); err is set if the frame failed. A frame is one socket
read or write, so it can hold several protocol messages or part of one.
Using it assumes an understanding of the NATS protocol the client sends and
receives. That protocol is not an API: what is sent can change with the
client or server version.
The function gets a copy of the frame, so it can't change what the client
sends or processes, but copying every frame costs memory and throughput.
debug: true doesn't copy. If the function throws, debug is turned off.
Set or remove it on a running connection through options.debug.
A
debugoption function. Called with each frame the client reads (">") or writes ("<");erris set if the frame failed. A frame is one socket read or write, so it can hold several protocol messages or part of one.Using it assumes an understanding of the NATS protocol the client sends and receives. That protocol is not an API: what is sent can change with the client or server version.
The function gets a copy of the frame, so it can't change what the client sends or processes, but copying every frame costs memory and throughput.
debug: truedoesn't copy. If the function throws, debug is turned off. Set or remove it on a running connection throughoptions.debug.