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 2008-2022 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>
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 <fcntl.h>
31 #include <inttypes.h>
32 #include <stddef.h>
33 #include <sys/stat.h>
34 #include <sys/types.h>
35 
36 #if !defined(_MSC_VER)
37 #include <netinet/in.h>
38 #include <netinet/tcp.h>
39 #include <sys/socket.h>
40 #include <unistd.h>
41 #endif
42 
43 typedef struct as_pipe_connection {
46  cf_ll readers;
47  bool canceling;
48  bool canceled;
49  bool in_pool;
51 
52 extern int
54 
55 extern int
57 
58 extern void
60 
61 extern bool
63 
64 extern void
65 as_pipe_socket_error(as_event_command* cmd, as_error* err, bool retry);
66 
67 extern void
68 as_pipe_timeout(as_event_command* cmd, bool retry);
69 
70 extern void
72 
73 extern void
75 
76 extern void
78 
79 extern void
81 
82 static inline as_event_command*
83 as_pipe_link_to_command(cf_ll_element* link)
84 {
85  return (as_event_command*)((uint8_t*)link - offsetof(as_event_command, pipe_link));
86 }
void as_pipe_get_connection(as_event_command *cmd)
as_event_connection base
Definition: as_pipe.h:44
#define as_socket_fd
Definition: as_socket.h:32
int as_pipe_get_recv_buffer_size(void)
void as_pipe_read_start(as_event_command *cmd)
void as_pipe_socket_error(as_event_command *cmd, as_error *err, bool retry)
void as_pipe_write_start(as_event_command *cmd)
static as_event_command * as_pipe_link_to_command(cf_ll_element *link)
Definition: as_pipe.h:83
void as_pipe_response_complete(as_event_command *cmd)
int as_pipe_get_send_buffer_size(void)
bool as_pipe_modify_fd(as_socket_fd fd)
void as_pipe_timeout(as_event_command *cmd, bool retry)
void as_pipe_response_error(as_event_command *cmd, as_error *err)
as_event_command * writer
Definition: as_pipe.h:45