20.01.2014 Views

Lectures notes for 2010 - KTH

Lectures notes for 2010 - KTH

Lectures notes for 2010 - KTH

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Learning about Socket programming<br />

For examples of using the socket API and networking programming see :<br />

• Richard Stevens, UNIX Network Programming, Volume 1, Second<br />

Edition: Networking APIs: Sockets and XTI, Prentice Hall, 1998, ISBN<br />

0-13-490012-X<br />

• source code ftp://ftp.kohala.com/pub/rstevens/unpv12e.tar.gz<br />

• errata list: http://www.kohala.com/~rstevens/typos.unpv12e.txt<br />

• Brian "Beej" Hall, “Beej’s Guide to Network Programming: Using<br />

Internet Sockets”, 04/08/2004 07:22:02 PM<br />

http://www.ecst.csuchico.edu/~beej/guide/net/<br />

Two addition socket functions <strong>for</strong> controlling various properties of sockets are:<br />

• int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen);<br />

• int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);<br />

For example, the options SO_SNDBUF and SO_RCVBUF - control the size of the<br />

sending buffer and the receiver buffer.<br />

Maguire Learning about Socket programming 4: 19 of 74<br />

maguire@kth.se <strong>2010</strong>.03.21 Internetworking/Internetteknik

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!