Effective reading



    The time has come for the seventh lecture of the course "Network Programming in UNIX", prepared by specialists of SkyDNS and Aydeko . Course author Alexander Patrakov explains to students how to speed up reading small portions of data from a socket.

    In the fourth lecture, Alexander told what to do if the recv () function returns fewer bytes than she was asked (in conditions when it is known how many bytes to read). Cases when you need to read before the separator (this is the case in protocols like http) were considered in passing.

    “In the fourth lecture, the simplest solution to the problem of reading to the delimiter was proposed - to read one byte in a loop. This leads to unjustified costs of processor time, ”explains Alexander Patrakov.

    Want to know how to avoid irrational reading by one byte? Watch a lecture!



    Slides are available here.

    Previous lectures:
    1. A course for those who are not afraid of UNIX and C
    2. To each client according to the process
    3. We implement the protocol or how astrologers work
    4. About how to read until the end
    5. Automatic programs - translation difficulties
    6. How to do several things at the same time and at the same time in turn?

    Also popular now: