19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 #ifndef NET_UTILS_MD_H 27 #define NET_UTILS_MD_H 28 29 #include <sys/socket.h> 30 #include <sys/types.h> 31 #include <netdb.h> 32 #include <netinet/in.h> 33 #include <unistd.h> 34 35 #include <sys/poll.h> 36 37 int NET_Timeout(int s, long timeout); 38 int NET_Read(int s, void* buf, size_t len); 39 int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, 40 struct sockaddr *from, socklen_t *fromlen); 41 int NET_ReadV(int s, const struct iovec * vector, int count); 42 int NET_Send(int s, void *msg, int len, unsigned int flags); 43 int NET_SendTo(int s, const void *msg, int len, unsigned int 44 flags, const struct sockaddr *to, int tolen); 45 int NET_Writev(int s, const struct iovec * vector, int count); 46 int NET_Connect(int s, struct sockaddr *addr, int addrlen); 47 int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen); 48 int NET_SocketClose(int s); 49 int NET_Dup2(int oldfd, int newfd); 50 int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout); 51 int NET_SocketAvailable(int s, jint *pbytes); 52 53 void NET_ThrowUnknownHostExceptionWithGaiError(JNIEnv *env, 54 const char* hostname, 55 int gai_error); 56 void NET_ThrowByNameWithLastError(JNIEnv *env, const char *name, 57 const char *defaultDetail); 58 | 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 #ifndef NET_UTILS_MD_H 27 #define NET_UTILS_MD_H 28 29 #include <sys/socket.h> 30 #include <sys/types.h> 31 #include <netdb.h> 32 #include <netinet/in.h> 33 #include <unistd.h> 34 35 #include <sys/poll.h> 36 37 int NET_Timeout(int s, long timeout); 38 int NET_Read(int s, void* buf, size_t len); 39 int NET_NonBlockingRead(int s, void* buf, size_t len); 40 int NET_TimeoutWithCurrentTime(int s, long timeout, long currentTime); 41 int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, 42 struct sockaddr *from, socklen_t *fromlen); 43 int NET_ReadV(int s, const struct iovec * vector, int count); 44 int NET_Send(int s, void *msg, int len, unsigned int flags); 45 int NET_SendTo(int s, const void *msg, int len, unsigned int 46 flags, const struct sockaddr *to, int tolen); 47 int NET_Writev(int s, const struct iovec * vector, int count); 48 int NET_Connect(int s, struct sockaddr *addr, int addrlen); 49 int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen); 50 int NET_SocketClose(int s); 51 int NET_Dup2(int oldfd, int newfd); 52 int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout); 53 int NET_SocketAvailable(int s, jint *pbytes); 54 55 void NET_ThrowUnknownHostExceptionWithGaiError(JNIEnv *env, 56 const char* hostname, 57 int gai_error); 58 void NET_ThrowByNameWithLastError(JNIEnv *env, const char *name, 59 const char *defaultDetail); 60 |