libhv API文档


libhv是一个跨平台的类似libevent、libev、libuv的异步事件驱动库,但提供了更加接近原生的API接口和更加丰富的协议。
libhv已广泛实用在公司的IOT平台、http API服务之中,正确性、稳定性、可扩展性、性能都有保证,完全开源,请放心使用。

项目地址:https://github.com/ithewei/libhv.git
码云镜像:https://gitee.com/ithewei/libhv.git
QQ技术交流群:739352073
libhv每日一学博文:https://hewei.blog.csdn.net/article/details/103903123

c

functions

hversion.h

  • get_compile_version
  • version_atoi
  • version_itoa

hmath.h

  • floor2e
  • ceil2e

hbase.h

  • getboolean
  • safe_malloc
  • safe_calloc
  • safe_realloc
  • safe_zalloc
  • safe_strncpy
  • safe_strncat
  • strlower
  • strupper
  • strreverse
  • strstartswith
  • strendswith
  • strcontains

htime.h

  • calc_next_timeout
  • datetime_now
  • datetime_past
  • datetime_future
  • datetime_mktime
  • datetime_fmt
  • gmtime_fmt
  • gettick
  • gethrtime
  • sleep
  • msleep
  • get_compile_datetime
  • days_of_month
  • month_atoi
  • month_itoa
  • weekday_atoi
  • weekday_itoa

hlog.h

  • default_logger
  • file_logger
  • stderr_logger
  • stdout_logger
  • logger_create
  • logger_destroy
  • logger_enable_color
  • logger_enable_fsync
  • logger_fsync
  • logger_print
  • logger_set_file
  • logger_set_handler
  • logger_set_level
  • logger_set_max_bufsize
  • logger_set_max_filesize
  • logger_set_remain_days

herr.h

  • hv_strerror

hsocket.h

  • Bind
  • Listen
  • Connect
  • ConnectNonblock
  • ConnectTimeout
  • Resolver
  • Socketpair
  • socket_strerror
  • sockaddrlen
  • sockaddr_assign
  • sockaddr_ip
  • sockaddr_port
  • sockaddr_set_port
  • sockaddr_str
  • sockaddr_print
  • tcp_nodelay
  • tcp_nopush
  • tcp_keepalive
  • udp_broadcast
  • so_sndtimeo
  • so_rcvtimeo

hproc.h

  • spawn_proc

hthread.h

  • gettid
  • hthread_create
  • hthread_join

hloop.h

  • create_tcp_client
  • create_tcp_server
  • create_udp_client
  • create_udp_server
  • hloop_new
  • hloop_free
  • hloop_run
  • hloop_stop
  • hloop_pause
  • hloop_resume
  • hloop_now
  • hloop_now_hrtime
  • hloop_now_ms
  • hloop_update_time
  • hloop_set_userdata
  • hloop_userdata
  • hloop_post_event
  • haccept
  • hconnect
  • hread
  • hwrite
  • hrecv
  • hsend
  • hrecvfrom
  • hsendto
  • hio_add
  • hio_del
  • hio_get
  • hio_read
  • hio_write
  • hio_close
  • hio_accept
  • hio_connect
  • hio_fd
  • hio_type
  • hio_error
  • hio_localaddr
  • hio_peeraddr
  • hio_setcb_accept
  • hio_setcb_connect
  • hio_setcb_read
  • hio_setcb_write
  • hio_setcb_close
  • hio_set_localaddr
  • hio_set_peeraddr
  • hio_set_readbuf
  • hio_set_type
  • hio_enable_ssl
  • htimer_add
  • htimer_add_period
  • htimer_del
  • htimer_reset
  • hidle_add
  • hidle_del

nlog.h

  • network_logger
  • nlog_listen

dns.h

  • dns_name_decode
  • dns_name_encode
  • dns_pack
  • dns_unpack
  • dns_rr_pack
  • dns_rr_unpack
  • dns_query
  • dns_free
  • nslookup

ftp.h

  • ftp_command_str
  • ftp_connect
  • ftp_login
  • ftp_exec
  • ftp_upload
  • ftp_download
  • ftp_download_with_cb
  • ftp_quit
  • ftp_status_str

smtp.h

  • smtp_command_str
  • smtp_status_str
  • smtp_build_command
  • sendmail

icmp.h

  • ping

httpdef.h

  • http_content_type_enum
  • http_content_type_enum_by_suffix
  • http_content_type_str
  • http_content_type_str_by_suffix
  • http_content_type_suffix
  • http_errno_description
  • http_errno_name
  • http_method_enum
  • http_method_str
  • http_status_enum
  • http_status_str

md5.h

  • MD5Init
  • MD5Update
  • MD5Final

base64.h

  • base64_decode
  • base64_encode

ssl_ctx.h

  • ssl_ctx_init
  • ssl_ctx_destory

cpp

functions

hmain.h

  • main_ctx_init
  • parse_opt
  • parse_opt_long
  • get_arg
  • get_env
  • setproctitle
  • signal_init
  • signal_handler
  • handle_signal
  • create_pidfile
  • delete_pidfile
  • getpid_form_pidfile
  • master_workers_run

hstring.h

  • asprintf
  • trim
  • trimL
  • trimR
  • trim_pairs
  • split
  • splitKV
  • replace
  • basename
  • dirname
  • filename
  • suffixname

hdir.h

  • listdir

hurl.h

  • url_escape
  • url_unescape

http_client.h

  • http_client_new
  • http_client_del
  • http_client_send
  • http_client_strerror
  • http_client_set_timeout
  • http_client_set_header
  • http_client_del_header
  • http_client_get_header
  • http_client_clear_headers

HttpServer.h

  • http_server_run
  • http_server_stop

http_content.h

  • parse_query_params
  • parse_json
  • parse_multipart
  • dump_query_params
  • dump_json
  • dump_multipart

hsysinfo.h

  • get_ncpu
  • get_meminfo

ifconfig.h

  • ifconfig

nmap.h

  • nmap_discovery
  • segment_discovery
  • host_discovery

classes

hscope.h

  • ScopeCleanup
  • ScopeFree
  • ScopeDelete
  • ScopeDeleteArray
  • ScopeRelease
  • ScopeLock

http

  • HttpMessage
  • HttpRequest
  • HttpResponse
  • HttpService

misc

  • IniParser
  • HObject
  • HVar
  • HFile
  • HThread
  • HThreadPool
  • HObjectPool
  • HBuf
  • HVLBuf
  • HRingBuf
  • HPoint
  • HSize
  • HRect
  • hv::MutexLock
  • hv::RWLock

marcos

hdef.h

  • ABS
  • ARRAY_SIZE
  • BITSET
  • BITCLR
  • BITGET
  • CR
  • LF
  • CRLF
  • LOWER
  • UPPER
  • IS_NUM
  • IS_UPPER
  • IS_LOWER
  • IS_ALPHA
  • IS_ALPHANUM
  • IS_HEX
  • IS_GRAPH
  • MAX
  • MIN
  • LIMIT
  • MAKE_FOURCC
  • MAKEWORD
  • HIBYTE
  • LOBYTE
  • MAKELONG
  • HIWORD
  • LOWORD
  • MAKEINT64
  • HIINT
  • LOINT
  • SAFE_ALLOC
  • SAFE_FREE
  • SAFE_DELETE
  • SAFE_DELETE_ARRAY
  • SAFE_RELEASE
  • STRINGIFY
  • STRINGCAT
  • FLOAT_EQUAL_ZERO
  • offsetof
  • offsetoffend
  • container_of
  • prefetch
  • printd
  • NULL
  • TRUE
  • FALSE
  • INFINITE
  • BEGIN_NAMESPACE
  • END_NAMESPACE
  • EXTERN_C
  • BEGIN_EXTERN_C
  • END_EXTERN_C
  • ENUM
  • STRUCT
  • DEFAULT

hlog.h

  • hlogd
  • hlogi
  • hlogw
  • hloge
  • hlogf
  • LOGD
  • LOGI
  • LOGW
  • LOGE
  • LOGF

hmutex.h

  • hmutex_t
  • hmutex_init
  • hmutex_destroy
  • hmutex_lock
  • hmutex_unlock
  • hspinlock_t
  • hspinlock_init
  • hspinlock_destroy
  • hspinlock_lock
  • hspinlock_unlock
  • hrwlock_t
  • hrwlock_init
  • hrwlock_destroy
  • hrwlock_rdlock
  • hrwlock_rdunlock
  • hrwlock_wrlock
  • hrwlock_wrunlock
  • htimed_mutex_t
  • htimed_mutex_init
  • htimed_mutex_destroy
  • htimed_mutex_lock
  • htimed_mutex_unlock
  • htimed_mutex_lock_for
  • hcondvar_t
  • hcondvar_init
  • hcondvar_destroy
  • hcondvar_wait
  • hcondvar_signal
  • hcondvar_broadcast
  • honce_t
  • HONCE_INIT
  • honce

hsocket.h

  • INVALID_SOCKET
  • closesocket
  • blocking
  • nonblocking
  • SOCKADDR_STRLEN
  • SOCKADDR_STR

hloop.h

  • hevent_loop
  • hevent_type
  • hevent_id
  • hevent_priority
  • hevent_userdata
  • hevent_set_priority
  • hevent_ser_userdata

hscope.h

  • defer

singleton.h

  • DISABLE_COPY
  • SINGLETON_DECL
  • SINGLETON_IMPL
发布了128 篇原创文章 · 获赞 142 · 访问量 28万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 代码科技 设计师: Amelia_0503

分享到微信朋友圈

×

扫一扫,手机浏览