sockets-goodppt

Sockets-goodppt - sockets Socket Programming in C/C c Mani Radhakrishnan and Jon Solworth c Mani Radhakrishnan and Jon Solworth Socket Programming

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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++ 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++ sockets TCP UDP Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either I connection based or connectionless : Is a connection established before communication or does each packet describe the destination? I packet based or streams based : Are there message boundaries or is it one stream? I reliable or unreliable . Can messages be lost, duplicated, reordered, or corrupted? c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++ sockets TCP UDP Socket characteristics Socket are characterized by their domain, type and transport protocol. Common domains are: I AF UNIX : address format is UNIX pathname I 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++ sockets TCP UDP Socket characteristics (cont’d) Each socket type has one or more protocols. Ex: I TCP/IP (virtual circuits) I UDP (datagram) Use of sockets: I Connection–based sockets communicate client-server: the server waits for a connection from the client I Connectionless sockets are peer-to-peer: each process is symmetric. c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++ sockets TCP UDP Socket APIs I socket : creates a socket of a given domain, type, protocol (buy a phone) I bind : assigns a name to the socket (get a telephone number) I listen : specifies the number of pending connections that can be queued for a server socket. (call waiting allowance) I accept : server accepts a connection request from a client (answer phone) I connect : client requests a connection request to a server (call) I send, sendto : write to connection (speak) I recv, recvfrom : read from connection (listen) I shutdown : end the call c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++ sockets TCP UDP Connection-based communication Server performs the following actions I socket : create the socket I bind : give the address of the socket on the server I listen : specifies the maximum number of connection requests that can be pending for this process I accept : establish the connection with a specific client I send,recv : stream-based equivalents of read and write (repeated) I shutdown : end reading or writing I close : release kernel data structures c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++ sockets TCP UDP TCP client Client performs the following actions I socket : create the socket I connect : connect to a server I send,recv : (repeated) I shutdown I close c Mani Radhakrishnan and Jon Solworth Socket Programming in C/C++ sockets...
View Full Document

This note was uploaded on 10/09/2009 for the course CS 5211 taught by Professor Xyz during the Fall '09 term at Minnesota.

Page1 / 40

Sockets-goodppt - sockets Socket Programming in C/C c Mani Radhakrishnan and Jon Solworth c Mani Radhakrishnan and Jon Solworth Socket Programming

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online