Are there any simple functions to check how much data is buffered but unread? FD_ISSET indicates only the presence of data in the buffer. Is it possible to create a second buffer in the program for more control over the buffer?
You can use recv()with flags MSG_PEEKand MSG_DONTWAIT, but there is no certainty that in this case there will be no more bytes than recv().
recv()
MSG_PEEK
MSG_DONTWAIT
Using a buffer in your program is a normal and acceptable way to solve a problem.
Source: https://habr.com/ru/post/1757438/More articles:Проблема с шрифтом в iPad-приложении - fontsWhat is the name of this method? - javascriptCreating multiple subsets in a single data.frame (possibly with ddply) - rХранение двоичных данных в виде строки в базе данных Web Sql - performanceThree columns a navigation bar based on the center width of the- htmlHow to specify arguments when running Android emulator in Eclipse (for data cleansing) - androidC ++ 5 dimensional vector? - c ++CRUD in Winforms with linq-to-sql - crudResource .getSystem (). OpenRawResource (random.txt) returns resource $ NotFoundException - javaCreating multiple Maven projects - maven-2All Articles