Loading...
Searching...
No Matches
raw_connection.h
Go to the documentation of this file.
#ifndef PROTON_RAW_CONNECTION_H
#define PROTON_RAW_CONNECTION_H 1
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include <proton/condition.h>
#include <proton/event.h>
#include <proton/import_export.h>
#include <proton/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct pn_raw_buffer_t {
uintptr_t context;
char *bytes;
uint32_t capacity;
uint32_t size;
uint32_t offset;
} pn_raw_buffer_t;
PNP_EXTERN pn_raw_connection_t *pn_raw_connection(void);
PNP_EXTERN const struct pn_netaddr_t *pn_raw_connection_local_addr(pn_raw_connection_t *connection);
PNP_EXTERN const struct pn_netaddr_t *pn_raw_connection_remote_addr(pn_raw_connection_t *connection);
PNP_EXTERN void pn_raw_connection_close(pn_raw_connection_t *connection);
PNP_EXTERN void pn_raw_connection_read_close(pn_raw_connection_t *connection);
PNP_EXTERN void pn_raw_connection_write_close(pn_raw_connection_t *connection);
PNP_EXTERN size_t pn_raw_connection_read_buffers_capacity(pn_raw_connection_t *connection);
PNP_EXTERN size_t pn_raw_connection_write_buffers_capacity(pn_raw_connection_t *connection);
PNP_EXTERN size_t pn_raw_connection_give_read_buffers(pn_raw_connection_t *connection, pn_raw_buffer_t const *buffers, size_t num);
PNP_EXTERN size_t pn_raw_connection_take_read_buffers(pn_raw_connection_t *connection, pn_raw_buffer_t *buffers, size_t num);
PNP_EXTERN size_t pn_raw_connection_write_buffers(pn_raw_connection_t *connection, pn_raw_buffer_t const *buffers, size_t num);
PNP_EXTERN size_t pn_raw_connection_take_written_buffers(pn_raw_connection_t *connection, pn_raw_buffer_t *buffers, size_t num);
PNP_EXTERN bool pn_raw_connection_is_read_closed(pn_raw_connection_t *connection);
PNP_EXTERN bool pn_raw_connection_is_write_closed(pn_raw_connection_t *connection);
PNP_EXTERN void pn_raw_connection_wake(pn_raw_connection_t *connection);
PNP_EXTERN pn_condition_t *pn_raw_connection_condition(pn_raw_connection_t *connection);
PNP_EXTERN void *pn_raw_connection_get_context(pn_raw_connection_t *connection);
PNP_EXTERN void pn_raw_connection_set_context(pn_raw_connection_t *connection, void *context);
PNP_EXTERN pn_record_t *pn_raw_connection_attachments(pn_raw_connection_t *connection);
PNP_EXTERN pn_raw_connection_t *pn_event_raw_connection(pn_event_t *event);
#ifdef __cplusplus
}
#endif
#endif /* raw_connection.h */
condition.h
An endpoint error state.
event.h
Protocol and transport events.
pn_condition_t
struct pn_condition_t pn_condition_t
An AMQP Condition object.
Definition condition.h:64
pn_event_t
struct pn_event_t pn_event_t
Notification of a state change in the protocol engine.
Definition event.h:75
pn_netaddr_t
struct pn_netaddr_t pn_netaddr_t
Unsettled API - The network address of a proactor transport.
Definition netaddr.h:42
pn_raw_buffer_t::capacity
uint32_t capacity
Count of available bytes starting at bytes.
Definition raw_connection.h:57
pn_raw_buffer_t::offset
uint32_t offset
First byte in the buffer to be read or written.
Definition raw_connection.h:59
pn_raw_buffer_t::size
uint32_t size
Number of bytes read or to be written starting at offset.
Definition raw_connection.h:58
pn_raw_buffer_t::bytes
char * bytes
Pointer to the start of the raw buffer, if this is null then no buffer is represented.
Definition raw_connection.h:56
pn_raw_buffer_t::context
uintptr_t context
Used to associate arbitrary application data with this raw buffer.
Definition raw_connection.h:55
pn_raw_connection_get_context
PNP_EXTERN void * pn_raw_connection_get_context(pn_raw_connection_t *connection)
Get the application context associated with this raw connection.
pn_raw_connection_read_buffers_capacity
PNP_EXTERN size_t pn_raw_connection_read_buffers_capacity(pn_raw_connection_t *connection)
Query the raw connection for how many more read buffers it can be given.
pn_raw_connection_write_buffers
PNP_EXTERN size_t pn_raw_connection_write_buffers(pn_raw_connection_t *connection, pn_raw_buffer_t const *buffers, size_t num)
Give the raw connection buffers to write to the underlying socket.
pn_raw_connection_take_written_buffers
PNP_EXTERN size_t pn_raw_connection_take_written_buffers(pn_raw_connection_t *connection, pn_raw_buffer_t *buffers, size_t num)
Return a buffer chain with buffers that have all been written to the raw socket.
pn_raw_connection_local_addr
PNP_EXTERN const struct pn_netaddr_t * pn_raw_connection_local_addr(pn_raw_connection_t *connection)
Get the local address of a raw connection.
pn_raw_connection_t
struct pn_raw_connection_t pn_raw_connection_t
A raw network connection used with the proactor.
Definition types.h:449
pn_raw_connection_attachments
PNP_EXTERN pn_record_t * pn_raw_connection_attachments(pn_raw_connection_t *connection)
Get the attachments that are associated with a raw connection.
pn_event_raw_connection
PNP_EXTERN pn_raw_connection_t * pn_event_raw_connection(pn_event_t *event)
Return the raw connection associated with an event.
pn_raw_connection
PNP_EXTERN pn_raw_connection_t * pn_raw_connection(void)
Create a new raw connection for use with the Proactor.
pn_raw_connection_read_close
PNP_EXTERN void pn_raw_connection_read_close(pn_raw_connection_t *connection)
Shutdown a raw connection for reading.
pn_raw_connection_condition
PNP_EXTERN pn_condition_t * pn_raw_connection_condition(pn_raw_connection_t *connection)
Get additional information about a raw connection error.
pn_raw_connection_write_buffers_capacity
PNP_EXTERN size_t pn_raw_connection_write_buffers_capacity(pn_raw_connection_t *connection)
Query the raw connection for how many more write buffers it can be given.
pn_raw_connection_wake
PNP_EXTERN void pn_raw_connection_wake(pn_raw_connection_t *connection)
Return a PN_RAW_CONNECTION_WAKE event for connection as soon as possible.
pn_raw_connection_give_read_buffers
PNP_EXTERN size_t pn_raw_connection_give_read_buffers(pn_raw_connection_t *connection, pn_raw_buffer_t const *buffers, size_t num)
Give the raw connection buffers to use for reading from the underlying socket.
pn_raw_connection_close
PNP_EXTERN void pn_raw_connection_close(pn_raw_connection_t *connection)
Close a raw connection.
pn_raw_connection_take_read_buffers
PNP_EXTERN size_t pn_raw_connection_take_read_buffers(pn_raw_connection_t *connection, pn_raw_buffer_t *buffers, size_t num)
Fetch buffers with bytes read from the raw socket.
pn_raw_connection_is_read_closed
PNP_EXTERN bool pn_raw_connection_is_read_closed(pn_raw_connection_t *connection)
Is connection closed for read?
pn_raw_connection_is_write_closed
PNP_EXTERN bool pn_raw_connection_is_write_closed(pn_raw_connection_t *connection)
Is connection closed for write?
pn_raw_connection_write_close
PNP_EXTERN void pn_raw_connection_write_close(pn_raw_connection_t *connection)
Shutdown a raw connection for writing.
pn_raw_connection_set_context
PNP_EXTERN void pn_raw_connection_set_context(pn_raw_connection_t *connection, void *context)
Set a new application context for a raw connection.
pn_raw_connection_remote_addr
PNP_EXTERN const struct pn_netaddr_t * pn_raw_connection_remote_addr(pn_raw_connection_t *connection)
Get the local address of a raw connection.
pn_raw_buffer_t
A descriptor used to represent a single raw buffer in memory.
Definition raw_connection.h:54
types.h
AMQP and API data types.