Connect & Interrupted System Call

xiaoxiao2021-03-06  51

One word, too cattle! Previously used a good Socket program, today's frequent error, the connection failed, viewed with PERROR to find it is Interrupter System Call! How is this going? Then Google The first is Unix Connect & Interrupted System Call, and I look at it, I can't say it! And there is also a super Richard Steven! Leave this code to save: / * Start with fd just returned by socket (), blocking, sock_stream ... * / while (connect (fd, & name, namelen) == -1 && errno! = Eisconn) IF ( Errno! = EINTR) {Perror ("Connect"); exit_failure;} / * at this point, fd is connected. * /

转载请注明原文地址:https://www.9cbs.com/read-110353.html

New Post(0)