{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sockets-goodppt - sockets Socket Programming in C/C c Mani...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
sockets Socket Programming in C/C++ c Mani Radhakrishnan and Jon Solworth September 24, 2004 c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
sockets Contact Info Mani Radhakrishnan Office 4224 SEL email mradhakr @ cs . uic . edu Office Hours Tuesday 1 - 4 PM c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 2
sockets TCP UDP Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either connection based or connectionless : Is a connection established before communication or does each packet describe the destination? packet based or streams based : Are there message boundaries or is it one stream? reliable or unreliable . Can messages be lost, duplicated, reordered, or corrupted? c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
sockets TCP UDP Socket characteristics Socket are characterized by their domain, type and transport protocol. Common domains are: AF UNIX : address format is UNIX pathname AF INET : address format is host and port number Common types are: virtual circuit: received in order transmitted and reliably datagram: arbitrary order, unreliable c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 4
sockets TCP UDP Socket characteristics (cont’d) Each socket type has one or more protocols. Ex: TCP/IP (virtual circuits) UDP (datagram) Use of sockets: Connection–based sockets communicate client-server: the server waits for a connection from the client Connectionless sockets are peer-to-peer: each process is symmetric. c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
sockets TCP UDP Socket APIs socket : creates a socket of a given domain, type, protocol (buy a phone) bind : assigns a name to the socket (get a telephone number) listen : specifies the number of pending connections that can be queued for a server socket. (call waiting allowance) accept : server accepts a connection request from a client (answer phone) connect : client requests a connection request to a server (call) send, sendto : write to connection (speak) recv, recvfrom : read from connection (listen) shutdown : end the call c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 6
sockets TCP UDP Connection-based communication Server performs the following actions socket : create the socket bind : give the address of the socket on the server listen : specifies the maximum number of connection requests that can be pending for this process accept : establish the connection with a specific client send,recv : stream-based equivalents of read and write (repeated) shutdown : end reading or writing close : release kernel data structures c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
sockets TCP UDP TCP client Client performs the following actions socket : create the socket connect : connect to a server send,recv : (repeated) shutdown close c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 8
sockets TCP UDP TCP-based sockets bind listen accept close send/recv shutdown close socket connect send/recv shutdown close server client socket c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern