Getsockopt - Advanced Unix Programming - Lecture Slides, Slides of Computer Programming

Some concept of Advanced Unix Programming are Address Structure, Basic Thread Functions, Client-Server Design, Network Programming, Signals and Thread, Thread-Specific Data, Unix File System, Reliable Communication. Main points of this lecture are: Getsockopt, Socket Options, Setsockopt, Introduction, Interface, Reliable Byte Stream Service, Connection Setup Overhead, Application, Communication, High Performance

Typology: Slides

2012/2013

Uploaded on 04/29/2013

parmita
parmita 🇮🇳

4.7

(17)

183 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Week 9 Topics
Socket options
getsockopt, setsockopt
fcntl
ioctl
Introduction to UDP
TCP vs UDP
UDP interface
Docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Getsockopt - Advanced Unix Programming - Lecture Slides and more Slides Computer Programming in PDF only on Docsity!

Week 9 Topics

• Socket options

  • getsockopt, setsockopt
  • fcntl
  • ioctl

• Introduction to UDP

  • TCP vs UDP
  • UDP interface

TCP vs UDP

• TCP

  • Reliable byte stream service
  • Connection setup overhead

• UDP

  • Unreliable datagram service
    • Data may get lost
      • Application may need to deal with more details in the communication

UDP interface

  • socket, bind, sendto, recvfrom, close

UDP server UDP client

socket socket bind sendto recvfrom recvfrom sendto close

TCP server TCP client

socket socket bind connect listen accept read/write close read/write close

UDP interface ... continued

  • #include <sys/socket.h>
    • ssize_t recvfrom(int sockfd, void *buff, size_t nbytes, int flags, struct sockaddr *from, socklen_t *addrlen);
    • ssize_t sendto(int sockfd, void *buff, size_t nbytes, int flags, const struct sockaddr *to, socklen_t addrlen);
  • See example1.c and example2.c for communication using UDP
  • Lost packets in UDP
    • How does the error rate vary with size of data?