<
classTRequest,
classTReply>
76 unsigned inttry_limit)
87 virtual void Ask(
constTRequest& request, TReply& reply)
88{
x_Ask(request, reply); }
120 return GetAffinity(
dynamic_cast<constTRequest&
>(request));
157 template<
classTRequest,
classTReply>
162 if( !m_Args.empty() ) {
165 "Error sending additional request arguments");
168 if( m_RetryCtx.IsSetArgs() ) {
172 "Error sending retry context arguments");
174}
else if(x_extra !=
nullptr&& !m_Affinity.empty()) {
177 "Error sending request affinity");
180 if(x_extra ==
nullptr) {
184memset(x_extra, 0,
sizeof(*x_extra));
185x_extra->
data= &m_RetryCtx;
188 const char* user_header = GetContentTypeHeader(
GetFormat());
189 if(user_header !=
NULL&& *user_header !=
'\0') {
192 "Error sending user header");
197 template<
classTRequest,
classTReply>
201 if(m_AsyncStream.get() !=
nullptr) {
202m_AsyncStream->SetTimeout(
eIO_Open, m_Timeout);
204x_SetStream(m_AsyncStream.release());
206}
else if( m_RetryCtx.IsSetUrl() ) {
207x_ConnectURL(m_RetryCtx.GetUrl());
210 _ASSERT( !m_Service.empty() );
213x_FillConnNetInfo(*net_info, &x_extra);
215unique_ptr<CConn_ServiceStream> stream
218 if( m_Canceler.NotNull() ) {
219stream->SetCanceledCallback(m_Canceler.GetNonNullPointer());
221x_SetStream(stream.release());
225 template<
classTRequest,
classTReply>
233x_FillConnNetInfo(*net_info,
nullptr);
242 if( m_Canceler.NotNull() ) {
243stream->SetCanceledCallback(m_Canceler.GetNonNullPointer());
245x_SetStream(stream.release());
249 template<
classTRequest,
classTReply>
256 const STimeout* old_timeout = m_Timeout;
257 if(sx_IsSpecial(timeout)) {
260m_Timeout =
new STimeout(*timeout);
262 if( !sx_IsSpecial(old_timeout) ) {
263 delete const_cast<STimeout*
>(old_timeout);
270 returnconn_stream->
SetTimeout(direction, timeout);
271}
else if( !m_Stream.get() ) {
279 template<
classTRequest,
classTReply>
295 template<
classTRequest,
classTReply>
301 _ASSERT( !m_Service.empty() );
304x_FillConnNetInfo(*net_info, &x_extra);
313 if( m_Canceler.NotNull() ) {
314m_AsyncStream->SetCanceledCallback(m_Canceler.GetNonNullPointer());
316 if(handle_buf !=
nullptr) {
317 CONN conn= m_AsyncStream->GetCONN();
318 if(
conn!=
nullptr) {
319 SOCKsock =
nullptr;
321&& sock !=
nullptr) {
330 template<
classTRequest,
classTReply>
349 template<
classTRequest,
classTReply>
Helper hook-up class that installs default logging/registry/locking (but only if they have not yet be...
This stream exchanges data with an HTTP server located at the URL: http[s]://host[:port]/path[?...
Base class, inherited from "std::iostream", does both input and output, using the specified CONNECTOR...
This stream exchanges data with a named service, in a constraint that the service is implemented as o...
HTTP-specific retry context implementation.
Base class for CRPCClient template - defines methods independent of request and response types.
CRPCClient â prototype client for ASN.1/XML-based RPC.
Base class for all serializable objects.
std::ofstream out("events_result.xml")
main entry point for tests
static CS_CONNECTION * conn
element_type * get(void) const
Get pointer.
const STimeout * GetTimeout(EIO_Event direction) const
EIO_Status SetTimeout(EIO_Event direction, const STimeout *timeout) const
Set connection timeout for "direction".
FHTTP_ParseHeader parse_header
EHTTP_HeaderParse
The extended version HTTP_CreateConnectorEx() is able to track the HTTP response chain and also chang...
EIO_Status CONN_GetSOCK(CONN conn, SOCK *sock)
Get an underlying SOCK handle for connection that is implemented as a socket.
@ fHTTP_NoAutoRetry
No auto-retries allowed.
@ fHTTP_AutoReconnect
See HTTP_CreateConnectorEx()
@ eHTTP_HeaderContinue
Parse succeeded, continue with body.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
CRPCClient(const string &service=kEmptyStr)
EIO_Status AsyncConnect(void *handle_buf, size_t handle_size)
virtual void x_WriteRequest(CObjectOStream &out, const CSerialObject &request) override
void x_ConnectURL(const string &url)
Connect to a URL.
CRPCClient(const string &service, ESerialDataFormat format)
virtual void ReadReply(CObjectIStream &in, TReply &reply)
static bool sx_IsSpecial(const STimeout *timeout)
CRPCClient(const string &service, ESerialDataFormat format, unsigned int try_limit)
static EHTTP_HeaderParse sx_ParseHeader(const char *http_header, void *user_data, int server_error)
virtual ~CRPCClient(void)
virtual void Ask(const TRequest &request, TReply &reply)
virtual void x_Connect(void) override
These run with m_Mutex already acquired.
virtual void WriteRequest(CObjectOStream &out, const TRequest &request)
const STimeout * GetTimeout(EIO_Event direction=eIO_Read) const
virtual void x_ReadReply(CObjectIStream &in, CSerialObject &reply) override
void x_FillConnNetInfo(SConnNetInfo &net_info, SSERVICE_Extra *x_extra)
static void Delete(SConnNetInfo *net_info)
virtual string GetAffinity(const TRequest &) const
unique_ptr< CConn_ServiceStream > m_AsyncStream
EIO_Status SetTimeout(const STimeout *timeout, EIO_Event direction=eIO_ReadWrite)
ESerialDataFormat
Data file format.
const STimeout * m_Timeout
Cloned if not special.
void x_Ask(const CSerialObject &request, CSerialObject &reply)
virtual string x_GetAffinity(const CSerialObject &request) const override
@ eSerial_AsnBinary
ASN.1 binary.
void ParseHeader(const char *http_header)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
@ fSERV_DelayOpen
Don't open service until use.
EIO_Status SOCK_GetOSHandle(SOCK sock, void *handle_buf, size_t handle_size)
Same as SOCK_GetOSHandleEx(sock, handle_buf, handle_size, eNoOwnership).
int ConnNetInfo_OverrideUserHeader(SConnNetInfo *net_info, const char *header)
int ConnNetInfo_ParseURL(SConnNetInfo *net_info, const char *url)
int ConnNetInfo_AppendArg(SConnNetInfo *net_info, const char *arg, const char *val)
int ConnNetInfo_PostOverrideArg(SConnNetInfo *net_info, const char *arg, const char *val)
SConnNetInfo * ConnNetInfo_Create(const char *service)
struct STimeoutTag STimeout
Timeout structure.
EIO_Event
I/O event (or direction).
void ConnNetInfo_Destroy(SConnNetInfo *net_info)
@ eIO_NotSupported
operation is not supported or is not available
@ eIO_Success
everything is fine, no error occurred
@ eIO_ReadWrite
eIO_Read | eIO_Write (also, eCONN_OnFlush)
@ eIO_Open
also serves as no-event indicator in SOCK_Poll
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
static const STimeout kZeroTimeout
Multi-threading â mutexes; rw-locks; semaphore.
std::istream & in(std::istream &in_, double &x_)
ESerialDataFormat GetFormat(const string &name)
Functor template for deleting object.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4