如何用Socket实现客户端通信模块[5]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 kanghc 的 blog

   _afx_sock_thread_state* pstate = _afxsockthreadstate;

      if (pstate->m_pmapsockethandle == null)

   pstate->m_pmapsockethandle = new cmapptrtoptr;

      if (pstate->m_pmapdeadsockets == null)

   pstate->m_pmapdeadsockets = new cmapptrtoptr;

      if (pstate->m_plistsocketnotifications == null)

   pstate->m_plistsocketnotifications = new cptrlist;

#endif

4.   总结

通信模块对很多程序来说,可能是一个很重要的模块。一个好的通信模块不仅要高效,而且要健壮。通信是一个动态过程,情况比较复杂,调试起来也比较费劲,因此,要写出一个好的通信模块,必须下一定的苦功。

以上谈到的是我个人对socket的一些浅薄的认识以及在实践过程的一点小小的经验。不足或不对之处,恳请各位同行多多指教。共勉!

 

 

 

 

 

 

来自北京三棵树软件技术有限公司

作者:hc.kang

2002-07-02

本文关键:通信,Socket,多线程
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top