When python socket is reading, the (recv) server is disconnected, and there is no exception at this time. What if I catch this error state?

the (recv) server is disconnected when python socket is read, and there is no exception at this time. What if I catch this error state?

Mar.10,2021

take the TCP protocol as an example. If socket uses blocking mode to call recv () , an empty string is returned, indicating that the TCP connection has been closed normally.

sample code is as follows

-sharp sk = socket(...)
-sharp ...
while True:
    data = sk.recv(1024)
    if not data:
        break  -sharp 
    -sharp ...
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37a63-3445e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37a63-3445e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?