O'Reilly logo

Linux Socket Programming by Example by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Using Standard I/O on Sockets

The example code in the previous chapters have all used the read(2) or write(2) system calls to perform read and write operations on sockets. The only exception to this rule was recvfrom(2) and sendto(2) function calls, which were used to read and write datagrams. There are application disadvantages to using the simple read(2) and write(2) calls, however.

This chapter will explore

  • How to associate a socket with a FILE stream using fdopen(3)

  • How to create and apply read and write FILE streams

  • Issues concerning closing streams associated sockets

  • Choosing and establishing the correct buffering technique for your FILE streams

  • The interrupted system call issue

Mastery of these topics will give you additional ways ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required