首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

请问一个boost反序列化抛出text_iarchive invalid signature错误的有关问题

2013-01-28 
请教一个boost反序列化抛出text_iarchiveinvalid signature异常的问题?我采用boost的序列化库,将数据信息

请教一个boost反序列化抛出text_iarchive invalid signature异常的问题?
我采用boost的序列化库,将数据信息序列化之后,跨网络传输。
代码如下:




         //反序列化mreq包
          stringstream os(mreq_ch);

          spfs_log(INFO,low,"ready to deserlization,context=%s.",os.str().c_str());
          try 
          {   
              text_iarchive(os)>>req;//在这一行构造抛出异常
          }   
          catch(const exception &e) 
          {   
              spfs_log(ERR,high,"text_iarchive err %s.",e.what());
          }   




但是序列化却没有问题:


     stringstream os ;
     text_oarchive(os)<<req;

     size_t req_len=strlen(os.str().c_str());



日志中的异常信息:
text_iarchive err invalid signature

请问这是什么原因造成的呢?
谢谢!
[解决办法]
果断抓包

热点排行