Main Page
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
aerospike
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
{
46
as_event_connection
base
;
47
as_event_command
*
writer
;
48
cf_ll
readers
;
49
bool
canceling
;
50
bool
canceled
;
51
bool
in_pool
;
52
}
as_pipe_connection
;
53
54
extern
int
55
as_pipe_get_send_buffer_size
();
56
57
extern
int
58
as_pipe_get_recv_buffer_size
();
59
60
extern
as_connection_status
61
as_pipe_get_connection
(
as_event_command
* cmd);
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);
68
69
extern
void
70
as_pipe_timeout
(
as_event_command
* cmd);
71
72
extern
void
73
as_pipe_response_error
(
as_event_command
* cmd,
as_error
* err);
74
75
extern
void
76
as_pipe_response_complete
(
as_event_command
* cmd);
77
78
extern
void
79
as_pipe_write_start
(
as_event_command
* cmd);
80
81
extern
void
82
as_pipe_read_start
(
as_event_command
* cmd);
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
}