[UNIX Network Programming Vo.1]--Something About Daytimeserver

来源:互联网 发布:mac比特币病毒怎么破解 编辑:程序博客网 时间:2024/05/22 08:04

1. If you're not already in the habit of using snprintf instead of the older sprintf, now's the time to learn. Calls to sprintf cannot check for overflow of the destination buffer. snprintf, on the other hand, requires that the second argument be the size of the destination buffer, and this buffer will not overflow.


2. Three steps communication between network:{

         These three steps, socket, bind, and listen, are the normal steps for any TCP server to prepare what we call the                listening descriptor (listenfd in this example).

     }

原创粉丝点击