2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 /***************************************************************************
19 * Description: Socket connections header file *
20 * Author: Gal Shachor <shachor@il.ibm.com> *
21 * Version: $Revision: 995751 $ *
22 ***************************************************************************/
27 #include "jk_logger.h"
28 #include "jk_global.h"
30 #if !defined(WIN32) && !(defined(NETWARE) && defined(__NOVELL_LIBC__))
31 #define closesocket close
37 #endif /* __cplusplus */
39 #define JK_SOCKET_EOF (-2)
41 int jk_resolve(const char *host, int port, struct sockaddr_in *rc, void *pool, jk_logger_t *l);
43 jk_sock_t jk_open_socket(struct sockaddr_in *addr, int keepalive,
44 int timeout, int connect_timeout,
45 int sock_buf, jk_logger_t *l);
47 int jk_close_socket(jk_sock_t sd, jk_logger_t *l);
49 int jk_shutdown_socket(jk_sock_t sd, jk_logger_t *l);
51 int jk_tcp_socket_sendfull(jk_sock_t sd, const unsigned char *b, int len, jk_logger_t *l);
53 int jk_tcp_socket_recvfull(jk_sock_t sd, unsigned char *b, int len, jk_logger_t *l);
55 char *jk_dump_hinfo(struct sockaddr_in *saddr, char *buf);
57 char *jk_dump_sinfo(jk_sock_t sd, char *buf);
59 int jk_is_input_event(jk_sock_t sd, int timeout, jk_logger_t *l);
61 int jk_is_socket_connected(jk_sock_t sd, jk_logger_t *l);
65 * i5/OS V5R4 need ASCII<->EBCDIC translation for inet_addr() call
67 #if !defined(AS400_UTF8)
69 #define jk_inet_addr inet_addr
76 #endif /* __cplusplus */
78 #endif /* JK_CONNECT_H */