All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_pipe.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aerospike, Inc.
3  *
4  * Portions may be licensed to Aerospike, Inc. under one or more contributor
5  * license agreements.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8  * use this file except in compliance with the License. You may obtain a copy of
9  * the License at http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14  * License for the specific language governing permissions and limitations under
15  * the License.
16  */
17 
18 #pragma once
19 
20 #include <aerospike/as_async.h>
21 #include <aerospike/as_log.h>
22 #include <aerospike/as_log_macros.h>
23 #include <aerospike/as_node.h>
24 #include <aerospike/as_socket.h>
25 
26 #include <citrusleaf/alloc.h>
27 #include <citrusleaf/cf_ll.h>
28 
29 #include <assert.h>
30 #include <errno.h>
31 #include <fcntl.h>
32 #include <inttypes.h>
33 #include <stdbool.h>
34 #include <stddef.h>
35 #include <stdint.h>
36 #include <unistd.h>
37 
38 #include <netinet/in.h>
39 #include <netinet/tcp.h>
40 
41 #include <sys/socket.h>
42 #include <sys/stat.h>
43 #include <sys/types.h>
44 
45 typedef struct as_pipe_connection {
48  cf_ll readers;
49  bool canceling;
50  bool canceled;
51  bool in_pool;
53 
54 extern int
56 
57 extern int
59 
60 extern void
62 
63 extern bool
64 as_pipe_modify_fd(int fd);
65 
66 extern void
67 as_pipe_socket_error(as_event_command* cmd, as_error* err, bool retry);
68 
69 extern void
70 as_pipe_timeout(as_event_command* cmd, bool retry);
71 
72 extern void
74 
75 extern void
77 
78 extern void
80 
81 extern void
83 
84 static inline as_event_command*
85 as_pipe_link_to_command(cf_ll_element* link)
86 {
87  return (as_event_command*)((uint8_t*)link - offsetof(as_event_command, pipe_link));
88 }