daokoder / dao-modules

Dao Standard Modules
http://daovm.net
12 stars 5 forks source link

Net: sending/receiving Dao data is not working #47

Closed Night-walker closed 9 years ago

Night-walker commented 9 years ago

DaoNetwork_ReceiveExt() inevitable hangs in attempt to receive more data then it was sent. Some parts of the logic seems incomplete (DPP_TRANS_END is never used). This functionality should either be fixed or removed from net, if it is no longer deemed necessary.

daokoder commented 9 years ago

I think it can be removed. After all, sending Dao value in binary format can only be supported for a few data types, but sending in serialized form can be supported for all serializable values. So it is more reasonable to remove this functionality now.

daokoder commented 9 years ago

BTW, with the last commit, net is broken with the following compiling error:

cd net && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
cc -ggdb -O0 -DDEBUG -DDAO_WITH_NUMARRAY -DDAO_WITH_DECORATOR -DDAO_WITH_THREAD -DDAO_WITH_CONCURRENT -DTARGET_PLAT=\"macosx\" -DCHANGESET_ID=\"FOS.ba0f220c92a7\" -DBSD=2 -DMACOSX=3 -DUNIX=1 -I../../kernel/ -fPIC  -c dao_network.c -o DaoMake.Objs/dao_network.c.13F2.o
dao_network.c:834:4: error: non-void function 'ParseAddr' should return a value [-Wreturn-type]
                        return;
                        ^
dao_network.c:838:13: warning: implicit declaration of function 'GetIpAddr' is invalid in C99
      [-Wimplicit-function-declaration]
        else if ( !GetIpAddr( buf, ip ) ){
                   ^
dao_network.c:813:29: warning: comparison of constant 18446744073709551615 with expression of type
      'unsigned int' is always false [-Wtautological-constant-out-of-range-compare]
        if ( *ptr != '\0' || ( num == ULONG_MAX && errno == ERANGE ) || num > 0xFFFF ){
                               ~~~ ^  ~~~~~~~~~
2 warnings and 1 error generated.
Night-walker commented 9 years ago

BTW, with the last commit, net is broken with the following compiling error

Damn C! I didn't even get a warning! Fixed.

daokoder commented 9 years ago

net.writeDao() and net.readDao() are now removed.