Author: markt Date: Wed Aug 5 19:19:19 2015 New Revision: 1694290 URL: http://svn.apache.org/r1694290 Log: Better document the inconsistent return values.
Modified: tomcat/trunk/java/org/apache/tomcat/jni/Socket.java Modified: tomcat/trunk/java/org/apache/tomcat/jni/Socket.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/Socket.java?rev=1694290&r1=1694289&r2=1694290&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/jni/Socket.java (original) +++ tomcat/trunk/java/org/apache/tomcat/jni/Socket.java Wed Aug 5 19:19:19 2015 @@ -379,12 +379,19 @@ public class Socket { * @param buf The buffer to store the data in. * @param offset Offset in the byte buffer. * @param nbytes The number of bytes to read (-1) for full array. - * @return the number of bytes received. + * @return If >= 0, the return value is the number of bytes read. Note a + * non-blocking read with no data current available will return + * {@link Status#EAGAIN} and EOF will return {@link Status#APR_EOF}. */ public static native int recvb(long sock, ByteBuffer buf, int offset, int nbytes); /** - * Read data from a network using internally set ByteBuffer + * Read data from a network using internally set ByteBuffer. + * + * @return If > 0, the return value is the number of bytes read. If == 0, + * the return value indicates EOF and if < 0 the return value is the + * error code. Note a non-blocking read with no data current + * available will return {@link Status#EAGAIN} not zero. */ public static native int recvbb(long sock, int offset, int nbytes); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org