Giter VIP home page Giter VIP logo

asyncnet's Introduction

AsyncNet

AsyncNet

Build

# git clone https://github.com/skywind3000/AsyncNet.git AsyncNet
# cd AsyncNet
# python tools/emake.py build/AsyncNet.mak

Demo

python AsyncNet.py

check test_async_core() and test_async_notify() in AsyncNet.py for more.

C/C++ Library

use tools/AsyncLoader.h tools/AsyncLoader.c in your code.

asyncnet's People

Contributors

skywind3000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asyncnet's Issues

win10 编译报错

我用 Mingw-w64 64bit 编译的,报了一个warning 和一些错误 导致 编译失败,编译报错好像是没有连接 wsock 库。
那个 warning 需要处理吗?谢谢!

compiling ...
source/AsyncExport.cpp
source/TraceLog.cpp
system/imembase.c
system/imemdata.c
system/inetbase.c
system/inetcode.c
system/inetkcp.c
system/inetnot.c
system/iposix.c
system/itoolbox.c
system/ineturl.c
In file included from system/ineturl.h:12,
from system/ineturl.c:10:
In function 'it_sresize',
inlined from 'it_strcpyc' at system/imemdata.h:530:3,
inlined from 'ihttplib_request' at system/ineturl.c:1036:4:
system/imemdata.h:216:4: warning: 'memcpy' forming offset [49, 56] is out of the bounds [0, 48] of object 'request' with type 'ivalue_t' {aka 'struct IVALUE'} [-Warray-bounds]
memcpy(&(v->param), it_ptr(v), newsize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
system/ineturl.c: In function 'ihttplib_request':
system/ineturl.c:995:11: note: 'request' declared here
ivalue_t request;
^~~~~~~
system/isecure.c
linking ...
build/objs/win32/inetbase.o:inetbase.c:(.text+0x6a5): undefined reference to __imp_select' build/objs/win32/inetbase.o:inetbase.c:(.text+0x7e8): undefined reference to __imp_htonl'
build/objs/win32/inetbase.o:inetbase.c:(.text+0xac8): undefined reference to __WSAFDIsSet' build/objs/win32/inetbase.o:inetbase.c:(.text+0xae2): undefined reference to __WSAFDIsSet'
build/objs/win32/inetbase.o:inetbase.c:(.text+0xafc): undefined reference to __WSAFDIsSet' build/objs/win32/inetbase.o:inetbase.c:(.text+0xbab): undefined reference to __WSAFDIsSet'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x1b4b): undefined reference to __imp_socket' build/objs/win32/inetbase.o:inetbase.c:(.text+0x1b8d): undefined reference to __imp_htonl'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x1ba3): undefined reference to __imp_bind' build/objs/win32/inetbase.o:inetbase.c:(.text+0x1bb5): undefined reference to __imp_closesocket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x1bde): undefined reference to __imp_getsockname' build/objs/win32/inetbase.o:inetbase.c:(.text+0x1bfe): undefined reference to __imp_listen'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x1c2d): undefined reference to __imp_connect' build/objs/win32/inetbase.o:inetbase.c:(.text+0x1c40): undefined reference to __imp_closesocket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x1c5a): undefined reference to __imp_accept' build/objs/win32/inetbase.o:inetbase.c:(.text+0x1c7e): undefined reference to __imp_getpeername'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x1cc6): undefined reference to __imp_closesocket' build/objs/win32/inetbase.o:inetbase.c:(.text+0x1ce5): undefined reference to __imp_closesocket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x1d01): undefined reference to __imp_closesocket' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2b46): undefined reference to __imp_socket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2b5a): undefined reference to __imp_closesocket' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2b8b): undefined reference to __imp_connect'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2bbe): undefined reference to __imp_connect' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2bd6): undefined reference to __imp_shutdown'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2bfb): undefined reference to __imp_bind' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2c2e): undefined reference to __imp_bind'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2c46): undefined reference to __imp_listen' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2c8c): undefined reference to __imp_accept'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2cd3): undefined reference to __imp_accept' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2cf3): undefined reference to __imp_WSAGetLastError'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2d06): undefined reference to __imp_send' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2d16): undefined reference to __imp_recv'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2d52): undefined reference to __imp_sendto' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2ddf): undefined reference to __imp_recvfrom'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2e2a): undefined reference to __imp_recvfrom' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2e46): undefined reference to __imp_ioctlsocket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2e56): undefined reference to __imp_setsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2e84): undefined reference to __imp_getsockopt'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2ea8): undefined reference to __imp_getsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2efc): undefined reference to __imp_getsockname'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2f43): undefined reference to __imp_getsockname' build/objs/win32/inetbase.o:inetbase.c:(.text+0x2f9c): undefined reference to __imp_getpeername'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x2fe3): undefined reference to __imp_getpeername' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3065): undefined reference to __imp_setsockopt'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x308d): undefined reference to __imp_setsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x30bf): undefined reference to __imp_ioctlsocket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x313d): undefined reference to __imp_setsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x316d): undefined reference to __imp_setsockopt'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x319f): undefined reference to __imp_ioctlsocket' build/objs/win32/inetbase.o:inetbase.c:(.text+0x325e): undefined reference to __imp_select'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x32cd): undefined reference to __imp_send' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3312): undefined reference to __imp_WSAGetLastError'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x335d): undefined reference to __imp_recv' build/objs/win32/inetbase.o:inetbase.c:(.text+0x33a2): undefined reference to __imp_WSAGetLastError'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x346f): undefined reference to __imp_gethostname' build/objs/win32/inetbase.o:inetbase.c:(.text+0x347e): undefined reference to __imp_gethostbyname'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x362e): undefined reference to __imp_select' build/objs/win32/inetbase.o:inetbase.c:(.text+0x397f): undefined reference to __imp_setsockopt'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x39d4): undefined reference to __imp_setsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3a35): undefined reference to __imp_WSAIoctl'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3a85): undefined reference to __imp_htonl' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3aa6): undefined reference to __imp_ntohl'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3ac6): undefined reference to __imp_htons' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3aea): undefined reference to __imp_ntohs'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3b53): undefined reference to __imp_htonl' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3b60): undefined reference to __imp_htons'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3bcf): undefined reference to __imp_gethostbyname' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3c05): undefined reference to __imp_inet_addr'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3c85): undefined reference to __imp_htons' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3da7): undefined reference to __imp_ntohs'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3e0d): undefined reference to __imp_ntohl' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3e2c): undefined reference to __imp_ntohs'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3efc): undefined reference to __imp_WSAStartup' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3f1e): undefined reference to __imp_WSACleanup'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3f86): undefined reference to __imp_socket' build/objs/win32/inetbase.o:inetbase.c:(.text+0x3fb7): undefined reference to __imp_socket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x3fe2): undefined reference to __imp_bind' build/objs/win32/inetbase.o:inetbase.c:(.text+0x4043): undefined reference to __imp_WSAIoctl'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x408f): undefined reference to __imp_setsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x4108): undefined reference to __imp_setsockopt'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x4134): undefined reference to __imp_setsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x415a): undefined reference to __imp_ioctlsocket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x4192): undefined reference to __imp_WSAGetLastError' build/objs/win32/inetbase.o:inetbase.c:(.text+0x41e2): undefined reference to __imp_closesocket'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x41fa): undefined reference to __imp_closesocket' build/objs/win32/inetbase.o:inetbase.c:(.text+0x4251): undefined reference to __imp_setsockopt'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x427e): undefined reference to __imp_setsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x42f9): undefined reference to __imp_select'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x4335): undefined reference to __imp_getsockopt' build/objs/win32/inetbase.o:inetbase.c:(.text+0x6f52): undefined reference to __imp_timeKillEvent'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x7013): undefined reference to __imp_timeSetEvent' build/objs/win32/inetbase.o:inetbase.c:(.text+0x70e5): undefined reference to __imp_timeKillEvent'
build/objs/win32/inetbase.o:inetbase.c:(.text+0x71f2): undefined reference to __imp_timeKillEvent' build/objs/win32/inetcode.o:inetcode.c:(.text+0x53b): undefined reference to __imp_select'
build/objs/win32/inetcode.o:inetcode.c:(.text+0x586): undefined reference to __imp_recv' build/objs/win32/inetcode.o:inetcode.c:(.text+0x5b2): undefined reference to __imp_WSAGetLastError'
build/objs/win32/inetcode.o:inetcode.c:(.text+0x7bf): undefined reference to __imp_select' build/objs/win32/inetcode.o:inetcode.c:(.text+0x7ef): undefined reference to __imp_send'
build/objs/win32/inetcode.o:inetcode.c:(.text+0x807): undefined reference to __imp_WSAGetLastError' build/objs/win32/inetcode.o:inetcode.c:(.text+0x8fe): undefined reference to __imp_gethostname'
build/objs/win32/inetcode.o:inetcode.c:(.text+0x9bf): undefined reference to __imp_gethostbyaddr' build/objs/win32/inetcode.o:inetcode.c:(.text+0x3bc1): undefined reference to __imp_socket'
build/objs/win32/inetcode.o:inetcode.c:(.text+0x3bfb): undefined reference to __imp_socket' build/objs/win32/inetcode.o:inetcode.c:(.text+0x3c8f): undefined reference to __imp_listen'
build/objs/win32/inetcode.o:inetcode.c:(.text+0x4e85): undefined reference to __imp_send' build/objs/win32/inetcode.o:inetcode.c:(.text+0x51e3): undefined reference to __imp_send'
build/objs/win32/inetcode.o:inetcode.c:(.text+0x63e1): undefined reference to __imp_htons' build/objs/win32/inetcode.o:inetcode.c:(.text+0x67bc): undefined reference to __imp_connect'
build/objs/win32/inetcode.o:inetcode.c:(.text+0x6823): undefined reference to __imp_select' build/objs/win32/inetcode.o:inetcode.c:(.text+0x6962): undefined reference to __imp_WSAGetLastError'
build/objs/win32/inetnot.o:inetnot.c:(.text+0xde): undefined reference to __imp_htons' build/objs/win32/inetnot.o:inetnot.c:(.text+0x142): undefined reference to __imp_htons'
build/objs/win32/inetnot.o:inetnot.c:(.text+0xc5c): undefined reference to __imp_ntohs' build/objs/win32/inetnot.o:inetnot.c:(.text+0xd37): undefined reference to __imp_ntohs'
build/objs/win32/inetnot.o:inetnot.c:(.text+0xda5): undefined reference to __imp_ntohs' build/objs/win32/inetnot.o:inetnot.c:(.text+0xdb8): undefined reference to __imp_ntohs'
build/objs/win32/ineturl.o:ineturl.c:(.text+0x67d): undefined reference to `__imp_socket'
collect2.exe: error: ld returned 1 exit status

itimer.c & itimer.h

IUINT32 interval;
IUINT32 current;
IUINT32 millisec;
IUINT32 jiffies;

those variables don't have enough space to store longer time.

请教韦老师关于模块化的问题?

您好,韦老师,请教点用 c 设计的问题。您在知乎上谈过 c 的思维,是自底向上的,逐步迭代的,强调可拆分性和简单性,这也成为了我学习设计的指导方法。

我也拜读了您的网络库,我发现我太不喜欢您那样 abcd.h:abcd.c = 1:1 的形式,因为这样给用户的 .h 会暴露太多信息。我更喜欢 libevent2 那么,分为内部使用 abcd-internal 和提供给外部使用的 include/abcd.h 。但是这样无疑让代码文件变多,也没有原来那么直观, 你认为这样是否是画蛇添足?或者说您觉得 libevent2 的设计怎么样?

很想听听您的建议...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.