A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/ncbi__uv__nghttp2_8hpp_source.html below:

NCBI C++ ToolKit: include/connect/impl/ncbi_uv_nghttp2.hpp Source File

1 #ifndef CONNECT__IMPL__NCBI_UV_NGHTTP2__HPP 2 #define CONNECT__IMPL__NCBI_UV_NGHTTP2__HPP 41 #include <nghttp2/nghttp2.h> 45 #include <forward_list> 47 #include <type_traits> 62  template

<

typename

T>

65  template

<

typename

T>

68  template

<

typename

T>

72  static const char

*

NgHttp2Str

(

T

e) {

return

nghttp2_strerror(

static_cast<int>

(e)); }

78  static const char

*

LibuvStr

(

T

e) {

return

uv_strerror(

static_cast<int>

(e)); }

85  template

<

typename

T>

91  template

<

typename

TFunc,

typename

T>

94  m_Value

<<

t

<<

f

(e) <<

" ("

<< e <<

") "

<< w;

100 template

<

typename

THandle>

107

uv_close(

reinterpret_cast<

uv_handle_t*

>

(

this

),

m_Cb

);

112

uv_ref(

reinterpret_cast<

uv_handle_t*

>

(

this

));

117

uv_unref(

reinterpret_cast<

uv_handle_t*

>

(

this

));

120  template

<

typename

TDerived>

123  return static_cast<

TDerived*

>

(handle);

135  SUv_Write

(

void

* user_data,

size_t

buf_size);

138  int Write

(uv_stream_t* handle, uv_write_cb cb);

139  void

OnWrite(uv_write_t* req);

147  bool

in_progress =

false

;

162  int

operator()(uv_tcp_t* handle, uv_connect_cb cb);

168  struct

sockaddr_in m_Address;

185  void

Close(

ECloseType

close_type = eCloseReset);

200  bool

CloseReset(ECloseType close_type);

202  void

OnConnect(uv_connect_t* req,

int

status);

203  void

OnAlloc(uv_handle_t*,

size_t

suggested_size, uv_buf_t*

buf

);

204  void

OnRead(uv_stream_t*,

ssize_t

nread,

const

uv_buf_t*

buf

);

205  void

OnWrite(uv_write_t*,

int

status);

206  void

OnClose(uv_handle_t*);

208  template

<

class

THandle,

class

...TArgs1,

class

...TArgs2>

209  static void OnCallback

(

void

(

SUv_Tcp

::*member)(THandle*, TArgs1...), THandle* handle, TArgs2&&... args)

211  auto

that =

static_cast<SUv_Tcp

*

>

(handle->data);

212

(that->*member)(handle, std::forward<TArgs2>(args)...);

234  void Init

(

void

* d, uv_loop_t*

l

, uv_async_cb cb)

236  if

(

auto

rc = uv_async_init(

l

,

this

, cb)) {

245  if

(

auto

rc = uv_async_send(

this

)) {

263  if

(

auto

rc = uv_timer_init(

l

,

this

)) {

276  if

(

auto

rc = uv_timer_stop(

this

)) {

286  if

(

auto

rc = uv_timer_start(

this

, m_Cb,

t

,

r

)) {

300  if

(

auto

rc = uv_barrier_init(&m_Barrier,

count

)) {

306

uv_barrier_destroy(&m_Barrier);

311  auto

rc = uv_barrier_wait(&m_Barrier);

331  if

(

auto

rc = uv_loop_init(

this

)) {

338  auto

rc = uv_run(

this

,

mode

);

347  if

(

auto

rc = uv_loop_close(

this

)) {

357 template

<u

int

8_t DEFAULT>

365  template

<

size_t

SIZE>

389  static

SConvert

Get

(initializer_list<SConvert>

l

,

size_t i

) {

return l

.size() <=

i

?

nullptr

: *(

l

.begin() +

i

); }

395

nghttp2_on_data_chunk_recv_callback on_data,

396

nghttp2_on_stream_close_callback on_stream_close,

397

nghttp2_on_header_callback on_header,

398

nghttp2_error_callback2 on_error,

399

nghttp2_on_frame_recv_callback on_frame_recv =

nullptr

);

402  void

Del(

int

terminate_rv);

404  int32_t

Submit(

const

nghttp2_nv *nva,

size_t

nvlen, nghttp2_data_provider* data_prd =

nullptr

);

405  int

Resume(

int32_t

stream_id);

421

nghttp2_session_del(m_Session);

422

m_Session =

nullptr

;

428

nghttp2_session* m_Session =

nullptr

;

440  static const string

&

Get

() {

static const string

user_agent(

Init

());

return

user_agent; }

443  static string Init

();

466  struct SId

:

private

pair<const string&, SUv_Tcp::TPort>

468  using

pair<const string&, SUv_Tcp::TPort>::pair;

469  friend

ostream&

operator<<

(ostream& os,

const SId

&

id

) { os <<

id

.first;

return id

.second ? os <<

"(:"

<<

id

.second <<

')'

: os; }

474  template

<

class

...TArgs>

485  int

OnError(nghttp2_session* session,

int

lib_error_code,

const char

*

msg

,

size_t len

);

493  template

<

typename

TR,

class

... TArgs>

496  return

[

this

, member](TArgs&&... args) -> TR {

return

(this->*member)(std::forward<TArgs>(args)...); };

499  void

OnConnect(

int

status);

500  void

OnWrite(

int

status);

501  void

OnRead(

const char

*

buf

,

ssize_t

nread);

506 template

<

class

TImpl>

509  template

<

class

... TArgs>

528  return GetThat

(user_data)->OnStreamClose(session, stream_id, error_code);

533  return GetThat

(user_data)->OnHeader(session, frame, name, namelen,

value

, valuelen,

flags

);

536  static int s_OnError

(nghttp2_session* session,

int

lib_error_code,

const char

*

msg

,

size_t len

,

void

* user_data)

538  return GetThat

(user_data)->OnError(session, lib_error_code,

msg

,

len

);

542 template

<

class

...TArgs>

544

m_Authority(addr_n_cred.

first

.AsString()),

547

addr_n_cred.proxy ? addr_n_cred.proxy : addr_n_cred.

first

,

554

m_Session(

this

, std::forward<TArgs>(args)...)

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

static const char * str(char *buf, int n)

#define ERR_POST(message)

Error posting with file, line number information but without error codes.

void Fatal(CExceptionArgs_Base &args)

void Write(CObjectOStream &out, TConstObjectPtr object, const CTypeRef &type)

#define NCBI_PARAM_DECL_EXPORT(expname, type, section, name)

Same as NCBI_PARAM_DECL but with export specifier (e.g.

#define NCBI_PARAM_TYPE(section, name)

Generate typename for a parameter from its {section, name} attributes.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

const struct ncbi::grid::netcache::search::fields::SIZE size

static PyObject * Connect(PyObject *self, PyObject *args, PyObject *kwargs)

const GenericPointer< typename T::ValueType > T2 value

Defines to provide correct exporting from DLLs in some configurations.

NCBI_PARAM_TYPE(UVNGHTTP2, test_identity) TUvNgHttp2_TestIdentity

NCBI C++ auxiliary debug macros.

The NCBI C++/STL use hints.

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

TInt x_DelOnError(TInt rv)

nghttp2_on_frame_recv_callback m_OnFrameRecv

pair< uint32_t, const uint32_t > m_MaxStreams

nghttp2_on_stream_close_callback m_OnStreamClose

nghttp2_error_callback2 m_OnError

nghttp2_on_header_callback m_OnHeader

uint32_t GetMaxStreams() const

nghttp2_on_data_chunk_recv_callback m_OnData

const char * operator()(T e)

friend ostream & operator<<(ostream &os, const SMbedTlsStr &str)

SUvNgHttp2_Error & operator<<(T &&v)

static SUvNgHttp2_Error FromNgHttp2(T e, const char *w)

static const char * LibuvStr(T e)

friend ostream & operator<<(ostream &os, const SUvNgHttp2_Error &error)

static const char * NgHttp2Str(T e)

static SUvNgHttp2_Error FromMbedTls(T e, const char *w)

static SMbedTlsStr MbedTlsStr(T e)

static SUvNgHttp2_Error FromLibuv(T e, const char *w)

SUvNgHttp2_Error(const char *t, TFunc f, T e, const char *w)

SUvNgHttp2_Error(const char *m="")

friend ostream & operator<<(ostream &os, const SId &id)

virtual void OnReset(SUvNgHttp2_Error error)=0

SUvNgHttp2_SessionBase(uv_loop_t *loop, const TAddrNCred &addr_n_cred, size_t rd_buf_size, size_t wr_buf_size, bool https, TArgs &&... args)

SNgHttp2_Session m_Session

virtual ~SUvNgHttp2_SessionBase()

unique_ptr< SUvNgHttp2_Tls > m_Tls

function< TR(TArgs...)> BindThis(TR(SUvNgHttp2_SessionBase::*member)(TArgs...))

static int s_OnStreamClose(nghttp2_session *session, int32_t stream_id, uint32_t error_code, void *user_data)

static int s_OnHeader(nghttp2_session *session, const nghttp2_frame *frame, const uint8_t *name, size_t namelen, const uint8_t *value, size_t valuelen, uint8_t flags, void *user_data)

static int s_OnData(nghttp2_session *session, uint8_t flags, int32_t stream_id, const uint8_t *data, size_t len, void *user_data)

static SUvNgHttp2_Session * GetThat(void *user_data)

static int s_OnError(nghttp2_session *session, int lib_error_code, const char *msg, size_t len, void *user_data)

SUvNgHttp2_Session(TArgs &&... args)

virtual const char * GetReadBuffer()=0

pair< string, string > TCred

function< vector< char > &()> TGetWriteBuf

pair< SSocketAddress, TCred > TAddrNCred

virtual vector< char > & GetWriteBuffer()=0

virtual ~SUvNgHttp2_Tls()

virtual int Read(const char *&buf, ssize_t &nread)=0

static const string & Get()

void Init(void *d, uv_loop_t *l, uv_async_cb cb)

SUv_Barrier(const SUv_Barrier &)=delete

SUv_Barrier & operator=(const SUv_Barrier &)=delete

SUv_Barrier(unsigned count)

SUv_Connect(const SUv_Connect &)=delete

SUv_Connect & operator=(const SUv_Connect &)=delete

static auto GetThat(THandle *handle)

SUv_Handle & operator=(const SUv_Handle &)=delete

SUv_Handle(uv_close_cb cb=nullptr)

SUv_Handle(const SUv_Handle &)=delete

void Run(uv_run_mode mode=UV_RUN_DEFAULT)

SUv_Loop(const SUv_Loop &)=delete

SUv_Loop & operator=(const SUv_Loop &)=delete

void OnWrite(uv_write_t *, int status)

vector< char > & GetWriteBuffer()

function< void(int)> TConnectCb

TPort GetLocalPort() const

static void s_OnAlloc(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)

void OnClose(uv_handle_t *)

void OnAlloc(uv_handle_t *, size_t suggested_size, uv_buf_t *buf)

static void s_OnClose(uv_handle_t *handle)

void OnRead(uv_stream_t *, ssize_t nread, const uv_buf_t *buf)

static void OnCallback(void(SUv_Tcp::*member)(THandle *, TArgs1...), THandle *handle, TArgs2 &&... args)

static void s_OnWrite(uv_write_t *req, int status)

function< void(int)> TWriteCb

function< void(const char *, ssize_t)> TReadCb

vector< char > m_ReadBuffer

static void s_OnRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)

void OnConnect(uv_connect_t *req, int status)

static void s_OnConnect(uv_connect_t *req, int status)

uint64_t GetDefaultRepeat() const

SUv_Timer(void *d, uv_timer_cb cb, uint64_t t, uint64_t r)

void Start(uint64_t t, uint64_t r)

void SetRepeat(uint64_t r)

vector< char > & GetBuffer()

forward_list< SBuffer > m_Buffers


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