Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocketChannelUDT.write(ByteByffer[] b, offset, len) assumes blocking behaviour #64

Open
superfell opened this issue Mar 25, 2014 · 1 comment

Comments

@superfell
Copy link

In the impl of this method, it walks through the buffers calling write(buffer) for each one. If the call to write writes less bytes than are remaining in the buffer it throws an exception, however for a non-blocking socket/channel its perfectly valid for write to write less than the entire buffer. (the write(ByteBuffer) seems to be doing the right thing, and just writing what it can).

@sinlang
Copy link

sinlang commented Oct 9, 2014

it default to block if you use NetSocketUDT, but you can use SocketChannelUDT instead if you want non-blocking program
by away , you can use netty 4 instead , netty 4 integrated barchart-udt as optional implementation

/** uses {@link TypeUDT#STREAM} socket in blocking mode */
public NetSocketUDT() throws ExceptionUDT {
this(new SocketUDT(TypeUDT.STREAM));
this.socketUDT.setBlocking(true);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants