_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