cvs commit: jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni Socket.java
mturk 2005/07/07 05:45:09 Modified:jni/java/org/apache/tomcat/jni Socket.java Log: optGet throws exception if APR call returns != APR_SUCCESS Revision ChangesPath 1.19 +3 -2 jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java Index: Socket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- Socket.java 18 Jun 2005 16:36:15 - 1.18 +++ Socket.java 7 Jul 2005 12:45:08 - 1.19 @@ -418,7 +418,8 @@ * /PRE * @return Socket option returned on the call. */ -public static native int optGet(long sock, int opt); +public static native int optGet(long sock, int opt) +throws Exception; /** * Setup socket timeout for the specified socket - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni Socket.java
mturk 2005/04/18 09:25:20 Modified:jni/java/org/apache/tomcat/jni Socket.java Log: Update javadocs for sendfilet. Revision ChangesPath 1.12 +3 -5 jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java Index: Socket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Socket.java 18 Apr 2005 16:22:22 - 1.11 +++ Socket.java 18 Apr 2005 16:25:20 - 1.12 @@ -448,10 +448,6 @@ /** * Send a file from an open file descriptor to a socket, along with * optional headers and trailers, with a timeout. - * br / - * This functions acts like a blocking write by default. To change - * this behavior, use apr_socket_timeout_set() or the - * APR_SO_NONBLOCK socket option. * The number of bytes actually sent is stored in the len parameter. * The offset parameter is passed by reference for no reason; its * value will never be modified by the apr_socket_sendfile() function. @@ -462,6 +458,8 @@ * @param offset Offset into the file where we should begin writing * @param len Number of bytes to send from the file * @param flags APR flags that are mapped to OS specific flags + * @param timeout Socket timeout to use with the call. The original + *socket timeout will be preserved. * @return Number of bytes actually sent, including headers, * file, and trailers * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni Socket.java
mturk 2005/04/16 08:07:53 Modified:jni/java/org/apache/tomcat/jni Socket.java Log: Oops. Remove duplicate declaration. Revision ChangesPath 1.10 +1 -9 jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java Index: Socket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Socket.java 16 Apr 2005 14:53:36 - 1.9 +++ Socket.java 16 Apr 2005 15:07:53 - 1.10 @@ -400,14 +400,6 @@ public static native int optGet(long sock, int opt); /** - * Query the specified socket if at the OOB/Urgent data mark - * @param sock The socket to query - * @return True if socket is at the OOB/urgent mark, - * otherwise is set to false. - */ -public static native boolean atmark(long sock); - -/** * Setup socket timeout for the specified socket * @param sock The socket to set up. * @param t Value for the timeout in microseconds. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni Socket.java
mturk 2005/04/14 09:41:08 Modified:jni/java/org/apache/tomcat/jni Socket.java Log: Remove exceptions from recv and send. Returned error codes are negative values. Revision ChangesPath 1.5 +8 -16 jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java Index: Socket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Socket.java 13 Apr 2005 13:17:27 - 1.4 +++ Socket.java 14 Apr 2005 16:41:08 - 1.5 @@ -186,8 +186,7 @@ * @return The number of bytes send. * */ -public static native int send(long sock, byte[] buf, int offset, int len) -throws Error; +public static native int send(long sock, byte[] buf, int offset, int len); /** * Send data over a network. @@ -211,8 +210,7 @@ * */ public static native int sendb(long sock, ByteBuffer buf, - int offset, int len) -throws Error; + int offset, int len); /** * Send multiple packets of data over a network. @@ -230,8 +228,7 @@ * @param vec The array from which to get the data to send. * */ -public static native int sendv(long sock, byte[][] vec) -throws Error; +public static native int sendv(long sock, byte[][] vec); /** * @param sock The socket to send from @@ -242,8 +239,7 @@ * @param len The length of the data to send */ public static native int sendto(long sock, long where, int flags, -byte[] buf, int offset, int len) -throws Error; +byte[] buf, int offset, int len); /** * Read data from a network. @@ -265,8 +261,7 @@ * @param nbytes The number of bytes to read (-1) for full array. * @return the number of bytes received. */ -public static native int recv(long sock, byte[] buf, int offset, int nbytes) -throws Error; +public static native int recv(long sock, byte[] buf, int offset, int nbytes); /** * Read data from a network. @@ -289,8 +284,7 @@ * @return the number of bytes received. */ public static native int recvb(long sock, ByteBuffer buf, - int offset, int nbytes) -throws Error; + int offset, int nbytes); /** @@ -303,9 +297,7 @@ * @return the number of bytes received. */ public static native int recvFrom(long from, long sock, int flags, - byte[] buf, int offset, int nbytes) -throws Error; - + byte[] buf, int offset, int nbytes); /** * Setup socket options for the specified socket - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni Socket.java
mturk 2005/04/13 06:17:27 Modified:jni/java/org/apache/tomcat/jni Socket.java Log: Add offset for send and receive oprations to skip the need for array copy. Revision ChangesPath 1.4 +62 -5 jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java Index: Socket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Socket.java 5 Feb 2005 12:31:05 - 1.3 +++ Socket.java 13 Apr 2005 13:17:27 - 1.4 @@ -16,6 +16,9 @@ package org.apache.tomcat.jni; +/* Import needed classes */ +import java.nio.ByteBuffer; + /** Socket * * @author Mladen Turk @@ -178,11 +181,37 @@ * /PRE * @param sock The socket to send the data over. * @param buf The buffer which contains the data to be sent. + * @param offset Offset in the byte buffer. * @param len The number of bytes to write; (-1) for full array. * @return The number of bytes send. * */ -public static native int send(long sock, byte[] buf, int len) +public static native int send(long sock, byte[] buf, int offset, int len) +throws Error; + +/** + * Send data over a network. + * PRE + * This functions acts like a blocking write by default. To change + * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK + * socket option. + * + * It is possible for both bytes to be sent and an error to be returned. + * + * APR_EINTR is never returned. + * /PRE + * @param sock The socket to send the data over. + * @param buf The Byte buffer which contains the data to be sent. + * @param offset The offset within the buffer array of the first buffer from + * which bytes are to be retrieved; must be non-negative + * and no larger than buf.length + * @param len The maximum number of buffers to be accessed; must be non-negative + *and no larger than buf.length - offset + * @return The number of bytes send. + * + */ +public static native int sendb(long sock, ByteBuffer buf, + int offset, int len) throws Error; /** @@ -209,10 +238,34 @@ * @param where The apr_sockaddr_t describing where to send the data * @param flags The flags to use * @param buf The data to send + * @param offset Offset in the byte buffer. * @param len The length of the data to send */ public static native int sendto(long sock, long where, int flags, -byte[] buf, int len) +byte[] buf, int offset, int len) +throws Error; + +/** + * Read data from a network. + * + * PRE + * This functions acts like a blocking read by default. To change + * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK + * socket option. + * The number of bytes actually received is stored in argument 3. + * + * It is possible for both bytes to be received and an APR_EOF or + * other error to be returned. + * + * APR_EINTR is never returned. + * /PRE + * @param sock The socket to read the data from. + * @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. + */ +public static native int recv(long sock, byte[] buf, int offset, int nbytes) throws Error; /** @@ -231,22 +284,26 @@ * /PRE * @param sock The socket to read the data from. * @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. */ -public static native int recv(long sock, byte[] buf, int nbytes) +public static native int recvb(long sock, ByteBuffer buf, + int offset, int nbytes) throws Error; + /** * @param from The apr_sockaddr_t to fill in the recipient info * @param sock The socket to use * @param flags The flags to use * @param buf The buffer to use + * @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. */ public static native int recvFrom(long from, long sock, int flags, -
cvs commit: jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni Socket.java
mturk 2005/02/05 04:31:05 Modified:jni/java/org/apache/tomcat/jni Socket.java Log: Fix native call naming for recvFrom Revision ChangesPath 1.3 +3 -3 jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java Index: Socket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Socket.java 14 Jan 2005 14:42:37 - 1.2 +++ Socket.java 5 Feb 2005 12:31:05 - 1.3 @@ -245,8 +245,8 @@ * @param nbytes The number of bytes to read (-1) for full array. * @return the number of bytes received. */ -public static native int recv(long from, long sock, int flags, - byte[] buf, int nbytes) +public static native int recvFrom(long from, long sock, int flags, + byte[] buf, int nbytes) throws Error; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]