iphone Application Programming L09: Networking

Size: px
Start display at page:

Download "iphone Application Programming L09: Networking"

Transcription

1 iphone Application Programming L09: Networking Prof. Dr., Florian Heller, Jonathan Diehl Media Computing Group, RWTH Aachen WS 2009/2010

2 Networking Bonjour Networking Push Notifications GameKit Remote (Web) Objects 2

3 Bonjour Networking 3

4 Bonjour Apples flavor of zeroconf networking a.k.a. multicast DNS Service discovery framework Does not transfer data Likely to become an official standard Also available for Unix/Linux & Windows 4

5 Using Bonjour As Server (NSNetService) Create a socket to provide the service Define service Name: Service name Type: Service type and transport layer ( _http._tcp. ) Registration domain ("local.") Port Publish service 5

6 Using Bonjour As Client Browse for available services / Create NSNetService directly Check if service is still available with resolvewithtimeout: Get socket information and connect 6

7 Bonjour Example // set up network service myservice = [[NSNetService alloc] initwithdomain:@"" type:@"_neighbors._tcp"!!!!!!!! name:[[uidevice currentdevice] name]!!!!!!!! port:9090]; myservice.delegate = self; // publish network service [myservice publish]; // published - (void)netservicedidpublish:(nsnetservice *)sender {! NSLog(@"published: %@", sender); } // not published - (void)netservice:(nsnetservice *)sender didnotpublish:(nsdictionary *)errordict {! NSLog(@"not published: %@ -> %@", sender, errordict); } - (void)netservice:(nsnetservice *)sender didupdatetxtrecorddata:(nsdata *)data {! NSString *message = [[NSString alloc] initwithdata:data encoding:nsutf8stringencoding];! NSLog(@"TXT: %@", message); } 7

8 Bonjour Example // set up array netservices = [[NSMutableArray alloc] init];! // set up the service browser servicebrowser = [[NSNetServiceBrowser alloc] init]; servicebrowser.delegate = self; [servicebrowser searchforservicesoftype:@"_neighbors._tcp" indomain:@""]; // new service - (void)netservicebrowser:(nsnetservicebrowser *)netservicebrowser didfindservice: (NSNetService *)netservice morecoming:(bool)moreservicescoming; {! [netservices addobject:netservice]; } // service removed - (void)netservicebrowser:(nsnetservicebrowser *)netservicebrowser didremoveservice: (NSNetService *)netservice morecoming:(bool)moreservicescoming; {! [netservices removeobject:netservice]; } 8

9 What s a Socket Combination of Address and port Listening socket handles data via callback 9

10 Socket Networking Sockets are used to actually transmit data CFSocket: C encapsulation of BSD sockets Runloop functionality, no blocking calls Objective C wrapper: CocoaAsyncSocket 10

11 Setting up a Listening Socket Create a socket context Create a socket Bind the socket to an address Handle events in a callback 11

12 CFSocketContext }; struct CFSocketContext { CFIndex version; void *info; CFAllocatorRetainCallBack retain; CFAllocatorReleaseCallBack release; CFAllocatorCopyDescriptionCallBack copydescription; 12

13 CFSocketCreate ); CFSocketRef CFSocketCreate ( CFAllocatorRef allocator, SInt32 protocolfamily, //default: PF_INET SInt32 sockettype, //default:sock_stream, UDP:SOCK_DGRAM SInt32 protocol, //STREAM:IPPROTO_TCP DGRAM:IPPROTO_UDP CFOptionFlags callbacktypes, CFSocketCallBack callout, const CFSocketContext *context 13

14 CFSocket Example CFSocketContext socketctxt = {0, self, NULL, NULL, NULL}; ipv4socket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP, kcfsocketacceptcallback, (CFSocketCallBack)&TCPServerAcceptCallBack, &socketctxt); struct sockaddr_in socketaddress; memset(&socketaddress, 0, sizeof(socketaddress)); socketaddress.sin_len = sizeof(socketaddress); socketaddress.sin_family = AF_INET; // Address family (IPv4 vs IPv6) socketaddress.sin_port = 0; // Actual port will get assigned automatically by kernel // We must use "network byte order" format (big-endian) for the value here socketaddress.sin_addr.s_addr = htonl(inaddr_any); // Convert the endpoint data structure into something that CFSocket can use NSData *socketaddressdata = [NSData datawithbytes:&socketaddress length:sizeof(socketaddress)]; //Bind to address CFSocketSetAddress(listeningSocket,(CFDataRef)socketAddressData) 14

15 CFSocket Example (Continued) //Create a runloop source for the socket CFRunLoopRef cfrl = CFRunLoopGetCurrent(); CFRunLoopSourceRef source4 = CFSocketCreateRunLoopSource(kCFAllocatorDefault, _ipv4socket, 0); CFRunLoopAddSource(cfrl, source4, kcfrunloopcommonmodes); CFRelease(source4); 15

16 CFSocket Callbacks static void TCPServerCallBack(CFSocketRef socket, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) { if (type == kcfsocketacceptcallback) {!! //handle a new connection } if (type == kcfsocketdatacallback) { //handle incoming data } } 16

17 Demo 17

18 Push Notifications 18

19 Push Notifications Notify the user that data is waiting Does not transmit data Behavior is defined by the user 19

20 Apple Push Notification Service Central service provided by Apple Your server connects to the APNS The APNS transmits the message to the device The user possibly starts your application Your application retrieves the data 20

21 Registering a Device registerforremotenotificationtypes:(uiremotenotificationtype)types UIRemoteNotificationTypeNone UIRemoteNotificationTypeBadge UIRemoteNotificationTypeSound UIRemoteNotificationTypeAlert Receive unique device token Communicate this token to your own server Your server specifies token when sending a payload to APNS 21

22 Registering a Device // Add registration for push nofication [[UIApplication sharedapplication] registerforremotenotificationtypes: (UIRemoteNotificationTypeBadge UIRemoteNotificationTypeSound UIRemoteNotificationTypeAlert)];! - (void)application:(uiapplication *)app didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken {!! NSLog(@"devToken=%@",deviceToken); } - (void)application:(uiapplication *)app didfailtoregisterforremotenotificationswitherror:(nserror *)err {!! NSLog(@"Error in registration. Error: %@", err); } - (void)unregisterforremotenotifications - (UIRemoteNotificationType)enabledRemoteNotificationTypes 22

23 Message Delivery Server connects to APNS via TCP connection SSL Secured Payload delivery not guaranteed Check the feedback service regularly 23

24 Example Payload } { "aps" : { "alert" : "You got your s.", "badge" : 9, "sound" : "bingbong.aiff" }, "acme1" : "bar", "acme2" : 42 24

25 Clear a Badge Number } { "aps" : { }, "acme2" : [ 5, 8 ] 25

26 APNS Requirements Own Server providing the service SSL certificate for your server Defined App ID registered for Push Notifications 26

27 GameKit High-level Framework for Bluetooth Networking Automatic Service Discovery Efficient, low-latency communication Integrated voice chat 27

28 GameKit Classes GKSession Discover peers and manage connections GKPeerPickerController Controller for showing and connecting to peers Comes with its own UI GKVoiceChatService control voice chat 28

29 GKPickerController Example - (void)viewdidload {! session = [[GKSession alloc] initwithsessionid:@"chat" displayname:nil sessionmode:gksessionmodepeer];! peerpickercontroller = [[GKPeerPickerController alloc] init];! peerpickercontroller.delegate = self;! [peerpickercontroller show]; }! # pragma mark GKPeerPickerControllerDelegate - (GKSession *)peerpickercontroller:(gkpeerpickercontroller *)picker sessionforconnectiontype:(gkpeerpickerconnectiontype)type {! return session; } - (void)peerpickercontroller:(gkpeerpickercontroller *)picker didconnectpeer:(nsstring *)peerid tosession:(gksession *)session {!... } 29

30 30

31 GKSession peerswithconnectionstate: list all peers with the given state (e.g. available) connecttopeer:withtimeout: request a connection to the peer acceptconnectionfrompeer:error: accept a connection request 31

32 GKSessionDelegate session:peer:didchangestate: informs delegate about new peers and state changes Possible states: available, unavailable, connecting, disconnecting, connected session:didreceiveconnectionrequestfrompeer: respond to connection request from peer Error handling session:connectionwithpeerfailed:witherror: session:didfailwitherror: 32

33 GKSession Communication setdatareceivehandler:withcontext: define receive handler (controller) for the session receivedata:frompeer:insession:context: implemented by receive handler senddata:topeers:withdatamode:error: send NSData to given peers Possible data modes: reliable, unreliable 33

34 GKVoiceChatService Singleton Service to control voice chat Manage connections Record audio from microphone Delegate: Client Transmit audio data Playback audio data 34

35 Remote (Web) Objects 35

36 Web-Backend Database Database Database Database Database Database Database 36

37 Web-Backend HTTP XML Web Backend Database 37

38 Ruby on Rails Open Source Web Application Framework Runs as its own service Main Components: ActionController: interface controller and routing ActiveRecord: database abstraction ActiveResource: remote objects 38

39 Ruby on Rails: Quickstart create the app: rails sample_application generate a model script/generate model person generate a scaffold controller script/generate scaffold person migrate the database rake db:migrate launch the server script/server 39

40 Representational State Transfer Data is made available through (web-)resources Each resource has its own URI HTTP operations are used to manipulate resources POST Communication via XML or JSON 40

41 REST Operations GET: request all resources (or by id) GET GET POST: update resource POST PUT: create resource PUT DELETE: delete resource DELETE 41

42 Ruby on Rails & REST Scaffold controller supports all REST operation script/generate scaffold people supports HTML (backend website) and XML Routes can be created automatically map.resources :people in routes.rb Format and id can be specified in URI

43 iphone HTTP Requests NSURL *url = [NSURL URLWithString:@" NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initwithurl:url]; // set the HTTP operation [request sethttpmethod:@"post"]; // set the post data NSData *postdata = [@"id=1&person[name]=paul" datausingencoding:nsutf8stringencoding]; [request sethttpbody:postdata]; // fire the request NSURLConnection *con = [NSURLConnection connectionwithrequest:request delegate:self]; [con start]; 43

44 Summary Discover services with Bonjour Receive notifications Connect to other devices vie BlueTooth Access remote objects Reading Assignment: Net Services Programming Guide Push Notification Service Programming Guide GameKit Guide 44

BCS Autumn School. Distinguish your application with Bonjour. Nan Xu. 20 November 2013

BCS Autumn School. Distinguish your application with Bonjour. Nan Xu. 20 November 2013 BCS Autumn School Distinguish your application with Bonjour Nan Xu 20 November 2013 About Speaker Director of Operations at Red7Mobile Ltd PRINCE2 project manager and Senior ios developer Have managed,

More information

AsyncNetwork Cocoa & ios Networking Evolved

AsyncNetwork Cocoa & ios Networking Evolved AsyncNetwork Cocoa & ios Networking Evolved Open Source (MIT License) github.com/jdiehl/async-network jonathan.diehl@rwth-aachen.de Client/Server One Server Many Clients Listen to incoming connections

More information

iphone Application Programming Networking

iphone Application Programming Networking iphone Application Programming Networking RWTH Aachen University WS 2015/16 http://hci.rwth-aachen.de/iphone Networking on ios There are many ways to network Think about what you need to do first Then

More information

iphone Application Programming Networking

iphone Application Programming Networking iphone Application Programming Networking Media Computing Group RWTH Aachen University WS 2013/2014 http://hci.rwth-aachen.de/iphone Networking Connect Two Peers Standard UI What Is the Peer Picker? Game

More information

CS193E Lecture 18. Web Kit and Networking with Bonjour & Distributed Objects

CS193E Lecture 18. Web Kit and Networking with Bonjour & Distributed Objects CS193E Lecture 18 Web Kit and Networking with Bonjour & Distributed Objects Web Kit Web Kit Framework for handling web content Provides the core of Safari functionality Open Source project http://webkit.org/

More information

An ios Static Library for Service Discovery and Dynamic Procedure Calls

An ios Static Library for Service Discovery and Dynamic Procedure Calls An ios Static Library for Service Discovery and Dynamic Procedure Calls Arnav Anshul Department of Engineering. Arizona State University Polytechnic Campus. arnavanshul@gmail.com Abstract - Remote procedure

More information

Socket Programming. Sungkyunkwan University. Hyunseung Choo Copyright Networking Laboratory

Socket Programming. Sungkyunkwan University. Hyunseung Choo Copyright Networking Laboratory Socket Programming Sungkyunkwan University Hyunseung Choo choo@skku.edu Copyright 2000-2019 Networking Laboratory Contents Goals Client-Server mechanism Introduction to socket Programming with socket on

More information

A Client-Server Exchange

A Client-Server Exchange Socket programming A Client-Server Exchange A server process and one or more client processes Server manages some resource. Server provides service by manipulating resource for clients. 1. Client sends

More information

Context. Distributed Systems: Sockets Programming. Alberto Bosio, Associate Professor UM Microelectronic Departement

Context. Distributed Systems: Sockets Programming. Alberto Bosio, Associate Professor UM Microelectronic Departement Distributed Systems: Sockets Programming Alberto Bosio, Associate Professor UM Microelectronic Departement bosio@lirmm.fr Context Computer Network hosts, routers, communication channels Hosts run applications

More information

Mobile Application Development L12: Storage & Communication

Mobile Application Development L12: Storage & Communication Mobile Application Development L12: Storage & Communication Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9) Data Storage & Communication Serialization & File Management SQLite Database CoreData

More information

Sockets 15H2. Inshik Song

Sockets 15H2. Inshik Song Sockets 15H2 Inshik Song Internet CAU www server (www.cau.ac.kr) Your web browser (Internet Explorer/Safari) Sockets 2 How do we find the server? Every computer on the Internet has an Internet address.

More information

Oral. Total. Dated Sign (2) (5) (3) (2)

Oral. Total. Dated Sign (2) (5) (3) (2) R N Oral Total Dated Sign (2) (5) (3) (2) Assignment Group- A_07 Problem Definition Write a program using TCP socket for wired network for following Say Hello to Each other ( For all students) File transfer

More information

Hybrid of client-server and P2P. Pure P2P Architecture. App-layer Protocols. Communicating Processes. Transport Service Requirements

Hybrid of client-server and P2P. Pure P2P Architecture. App-layer Protocols. Communicating Processes. Transport Service Requirements Announcements CS 5565 Network Architecture and Protocols Lecture 5 Godmar Back Problem Set 1 due Feb 17 Project 1 handed out shortly 2 Layer The Layer Let s look at some s (in keeping with top-down) architectures:

More information

Universal Linking Developer s Guide Release

Universal Linking Developer s Guide Release Oracle Responsys Universal Linking Developer s Guide Release 6.29.01 October 2016 Documentation for Oracle Responsys customers who are modifying the ios version of their mobile apps to handle direct links

More information

Multitasking Support on the ios Platform

Multitasking Support on the ios Platform Multitasking Support on the ios Platform Priya Rajagopal Invicara (www.invicara.com) @rajagp Multitasking on ios? Multitasking allows apps to perform certain tasks in the background while you're using

More information

Introduction to Client-Server Model

Introduction to Client-Server Model Preview Introduction to Client-Server Model Motivation of Client-Server Model Terminologies and Concepts in Client-Server Model Connectionless vs. Connection-Oriented Stateless vs. Stateful Server Identify

More information

Distributed Systems. 02. Networking. Paul Krzyzanowski. Rutgers University. Fall 2017

Distributed Systems. 02. Networking. Paul Krzyzanowski. Rutgers University. Fall 2017 Distributed Systems 02. Networking Paul Krzyzanowski Rutgers University Fall 2017 1 Inter-computer communication Without shared memory, computers need to communicate Direct link Direct links aren't practical

More information

Notification Services

Notification Services , page 1 Service Option Configuration, page 9 Notification in Policy Builder relates to pushing messages from Policy Builder to subscribers. Service Providers can use messages to alert the subscriber to

More information

Socket Programming. Dr. -Ing. Abdalkarim Awad. Informatik 7 Rechnernetze und Kommunikationssysteme

Socket Programming. Dr. -Ing. Abdalkarim Awad. Informatik 7 Rechnernetze und Kommunikationssysteme Socket Programming Dr. -Ing. Abdalkarim Awad Informatik 7 Rechnernetze und Kommunikationssysteme Before we start Can you find the ip address of an interface? Can you find the mac address of an interface?

More information

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University Sockets Hyo-bong Son (proshb@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Client-Server Model Most network application is based on the client-server model: A server

More information

Rails: MVC in action

Rails: MVC in action Ruby on Rails Basic Facts 1. Rails is a web application framework built upon, and written in, the Ruby programming language. 2. Open source 3. Easy to learn; difficult to master. 4. Fun (and a time-saver)!

More information

ios Application Development Course Details

ios Application Development Course Details ios Application Development Course Details By Besant Technologies Course Name Category Venue ios Application Development Mobile Application Development Besant Technologies No.24, Nagendra Nagar, Velachery

More information

Applications and Layered Architectures. Chapter 2 Communication Networks Leon-Garcia, Widjaja

Applications and Layered Architectures. Chapter 2 Communication Networks Leon-Garcia, Widjaja Applications and Layered Architectures Chapter 2 Communication Networks Leon-Garcia, Widjaja Network Architecture Architecture: Any design or orderly arrangement perceived by man. The goals of a network:

More information

Network Software Implementations

Network Software Implementations Network Software Implementations Number of computers on the Internet doubling yearly since 1981, nearing 200 million Estimated that more than 600 million people use the Internet Number of bits transmitted

More information

About the MBS Xojo Network Kit 2. NSConnection Wrapper 3. NSNetService Wrapper 4. Interfaces 5. NetworkKitUtilityModule 5. NSNetServiceBrowserMB 6

About the MBS Xojo Network Kit 2. NSConnection Wrapper 3. NSNetService Wrapper 4. Interfaces 5. NetworkKitUtilityModule 5. NSNetServiceBrowserMB 6 MBS Xojo Network Kit Version 1.0, 2015 by Christian Schmitz About the MBS Xojo Network Kit 2 NSConnection Wrapper 3 NSNetService Wrapper 4 Interfaces 5 NetworkKitUtilityModule 5 NSNetServiceBrowserMB 6

More information

upnp Device Architecture

upnp Device Architecture upnp and DLNA upnp Device Architecture defines an architecture for pervasive peer-to-peer network connectivity of intelligent appliances, wireless devices, and PCs of all form factors easy-to-use, flexible,

More information

Internet applications

Internet applications CSc 450/550 Computer Networks Worldwide Web Jianping Pan Summer 2006 5/18/06 CSc 450/550 1 Traditionally Internet applications remote login: e.g., telnet file transfer: e.g., FTP electronic mail: e.g.,

More information

Cisco StadiumVision Mobile API for Apple ios

Cisco StadiumVision Mobile API for Apple ios CHAPTER 1 Revised: March 28, 2013 Introduction to The ios SDK is provided as a set of static libraries, header files, and an a sample ios app (with a complete Xcode project). This API uses Objective-C

More information

Notification SDK. Integration Guide 4.17

Notification SDK. Integration Guide 4.17 Notification SDK Integration Guide 4.17 Disclaimer Disclaimer of Warranties and Limitations of Liabilities Legal Notices Copyright 2013 2017 VASCO Data Security, Inc., VASCO Data Security International

More information

Sockets. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Sockets. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Sockets Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Internet Connections (1) Connection Clients and servers communicate by sending streams of

More information

Courslets, a golf improvement web service. Peter Battaglia

Courslets, a golf improvement web service. Peter Battaglia Courslets, a golf improvement web service Peter Battaglia Discussion Project Overview Design and Technologies Utilized Rails and REST URLs, URLs, URLs Rails and Web Services What s s exposed as a service?

More information

PA #2 Reviews. set_name, get_name, del_name. Questions? Will be modified after PA #4 ~

PA #2 Reviews. set_name, get_name, del_name. Questions? Will be modified after PA #4 ~ Sockets Prof. Jin-Soo Kim( jinsookim@skku.edu) TA Dong-Yun Lee(dylee@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu PA #2 Reviews set_name, get_name, del_name Will

More information

Randall Stewart, Cisco Systems Phill Conrad, University of Delaware

Randall Stewart, Cisco Systems Phill Conrad, University of Delaware SCTP: An Overview Randall Stewart, Cisco Systems Phill Conrad, University of Delaware 1 Our Objectives Be able to explain what SCTP is, and what its major features are when and why you might use it (instead

More information

Operating Systems. 16. Networking. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski

Operating Systems. 16. Networking. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski Operating Systems 16. Networking Paul Krzyzanowski Rutgers University Spring 2015 1 Local Area Network (LAN) LAN = communications network Small area (building, set of buildings) Same, sometimes shared,

More information

Internet Connectivity with

Internet Connectivity with Internet Connectivity with Introduction The purpose of this workshop is to help you g et acquainted with the basics of internet connectivity by leveraging ARM mbed tools. If you are not already familiar

More information

SOCKET PROGRAMMING. What is a socket? Using sockets Types (Protocols) Associated functions Styles

SOCKET PROGRAMMING. What is a socket? Using sockets Types (Protocols) Associated functions Styles LABORATORY SOCKET PROGRAMMING What is a socket? Using sockets Types (Protocols) Associated functions Styles 2 WHAT IS A SOCKET? An interface between application and network The application creates a socket

More information

Types (Protocols) Associated functions Styles We will look at using sockets in C Java sockets are conceptually quite similar

Types (Protocols) Associated functions Styles We will look at using sockets in C Java sockets are conceptually quite similar Socket Programming What is a socket? Using sockets Types (Protocols) Associated functions Styles We will look at using sockets in C Java sockets are conceptually quite similar - Advanced Data Communications:

More information

Mobile Application Development

Mobile Application Development Mobile Application Development Lecture 17 Blocks, Concurrency, Networking 2013/2014 Parma Università degli Studi di Parma Lecture Summary Blocks Concurrency and multithreading Grand Central Dispatch (GCD)

More information

Lab 0. Yvan Petillot. Networks - Lab 0 1

Lab 0. Yvan Petillot. Networks - Lab 0 1 Lab 0 Yvan Petillot Networks - Lab 0 1 What You Will Do In This Lab. The purpose of this lab is to help you become familiar with the UNIX/LINUX on the lab network. This means being able to do editing,

More information

Distributed Systems 26. Mobile Ad Hoc Mesh Networks

Distributed Systems 26. Mobile Ad Hoc Mesh Networks Distributed Systems 26. Mobile Ad Hoc Mesh Networks Paul Krzyzanowski pxk@cs.rutgers.edu 12/16/2011 1 Mesh Networks Mobile Ad-hoc networks, sensor networks, Decentralized networking No need for routers

More information

CSMC 412. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 2. September 15 CMSC417 Set 2 1

CSMC 412. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 2. September 15 CMSC417 Set 2 1 CSMC 412 Computer Networks Prof. Ashok K Agrawala 2015 Ashok Agrawala Set 2 September 15 CMSC417 Set 2 1 Contents Client-server paradigm End systems Clients and servers Sockets Socket abstraction Socket

More information

CS321: Computer Networks Introduction to Application Layer

CS321: Computer Networks Introduction to Application Layer CS321: Computer Networks Introduction to Application Layer Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in Basic Application layer provides services to the

More information

CS434/534: Topics in Networked (Networking) Systems

CS434/534: Topics in Networked (Networking) Systems CS434/534: Topics in Networked (Networking) Systems Mobile Networking System: Making Connections: Cloud; NFC Yang (Richard) Yang Computer Science Department Yale University 208A Watson Email: yry@cs.yale.edu

More information

Socket Programming TCP UDP

Socket Programming TCP UDP Socket Programming TCP UDP Introduction Computer Network hosts, routers, communication channels Hosts run applications Routers forward information Packets: sequence of bytes contain control information

More information

TCP: Three-way handshake

TCP: Three-way handshake Sockets in C 1 Sockets in C The slides by themselves will not be sufficient to learn how to write socket code. If you did not attend class, then you will want to review the relevant chapters in Kerrisk

More information

IERG 4080 Building Scalable Internet-based Services

IERG 4080 Building Scalable Internet-based Services Department of Information Engineering, CUHK MScIE 2 nd Semester, 2015/16 IERG 4080 Building Scalable Internet-based Services Lecture 9 Web Sockets for Real-time Communications Lecturer: Albert C. M. Au

More information

CSCI-2320 Web Programming: Ruby on Rails

CSCI-2320 Web Programming: Ruby on Rails CSCI-2320 Web Programming: Ruby on Rails Mohammad T. Irfan Plan u Model-View-Controller (MVC) framework of web programming u Ruby on Rails 1 Ruby on Rails u Developed by David Hansson released 2004 u MVC

More information

Instructions for the Day of Ruby Ruby on Rails Tutorial

Instructions for the Day of Ruby Ruby on Rails Tutorial Instructions for the Day of Ruby Ruby on Rails Tutorial 1. Make sure you have the vendor files from http://www.cornetdesign.com/files/dor.zip. 2. Open a terminal window and change to a project directory.

More information

ECE 435 Network Engineering Lecture 2

ECE 435 Network Engineering Lecture 2 ECE 435 Network Engineering Lecture 2 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 31 August 2017 Announcements Homework 1 will be posted. Will be on website, will announce

More information

Notifications. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder

Notifications. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Notifications Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline Alerts Internal notifications Local

More information

Review. Preview. Closing a TCP Connection. Closing a TCP Connection. Port Numbers 11/27/2017. Packet Exchange for TCP Connection

Review. Preview. Closing a TCP Connection. Closing a TCP Connection. Port Numbers 11/27/2017. Packet Exchange for TCP Connection Review Preview Algorithms and Issues in Client Software Design Client Architecture Identifying the Location of a Parsing an Address Argument Looking Up a Domain Name Looking Up a Well-Known Port by Name

More information

DISTRIBUTED COMPUTER SYSTEMS

DISTRIBUTED COMPUTER SYSTEMS DISTRIBUTED COMPUTER SYSTEMS MESSAGE ORIENTED COMMUNICATIONS Dr. Jack Lange Computer Science Department University of Pittsburgh Fall 2015 Outline Message Oriented Communication Sockets and Socket API

More information

Cross Platform Nearby Networking

Cross Platform Nearby Networking Core OS #WWDC14 Cross Platform Nearby Networking Session 709 Demijan Klinc Software Engineer 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

CS UDP: User Datagram Protocol, Other Transports, Sockets. congestion worse);

CS UDP: User Datagram Protocol, Other Transports, Sockets. congestion worse); CS314-26 UDP: User Datagram Protocol, Other Transports, Sockets! IP is an unreliable datagram protocol " congestion or transmission errors cause lost packets " multiple routes may lead to out-of-order

More information

Network Communication

Network Communication Network Communication Processes communicating Process: program running within a host. q within same host, two processes communicate using inter- process communica6on (defined by OS). q processes in different

More information

Mobile Application Development L14: Miscellaneous

Mobile Application Development L14: Miscellaneous Mobile Application Development L14: Miscellaneous Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9) Agenda Accessing Contacts, Calendars, and Email Using the Camera User Preferences & Settings

More information

Eduardo

Eduardo Eduardo Silva @edsiper eduardo@treasure-data.com About Me Eduardo Silva Github & Twitter Personal Blog @edsiper http://edsiper.linuxchile.cl Treasure Data Open Source Engineer Fluentd / Fluent Bit http://github.com/fluent

More information

UNIT IV- SOCKETS Part A

UNIT IV- SOCKETS Part A 1. Define sockets - SOCKETS Part A A socket is a construct to provide a communication between computers. It hides the underlying networking concepts and provides us with an interface to communicate between

More information

Contents. iphone Training. Industry Trainers. Classroom Training Online Training ON-DEMAND Training. Read what you need

Contents. iphone Training. Industry Trainers. Classroom Training Online Training ON-DEMAND Training. Read what you need iphone Training Contents About iphone Training Our ios training classes can help you get off to a running start in iphone, ipod and ipad app development. Learn from expert Objective-C developers with years

More information

Computer Networks Prof. Ashok K. Agrawala

Computer Networks Prof. Ashok K. Agrawala CMSC417 Computer Networks Prof. Ashok K. Agrawala 2018Ashok Agrawala September 6, 2018 Fall 2018 Sept 6, 2018 1 Overview Client-server paradigm End systems Clients and servers Sockets Socket abstraction

More information

E Event-based parser, XML, 180 Extended attributes, URLs, 118 API, 119 command line, 118 description, 118 NSURL category, 119

E Event-based parser, XML, 180 Extended attributes, URLs, 118 API, 119 command line, 118 description, 118 NSURL category, 119 Index A Access control lists (ACLs), 113 Application distribution, 353 certificate utility, 358 App ID creation, 358 App Store, 363 center, 357 no of certificates, 358 code sign identity, 362 configuring

More information

Integrating Mobile Applications - Contrasting the Browser with Native OS Apps. Cary FitzGerald

Integrating Mobile Applications - Contrasting the Browser with Native OS Apps. Cary FitzGerald Integrating Mobile Applications - Contrasting the Browser with Native OS Apps Cary FitzGerald caryfitz@employees.org Workshop Leaders Peter Dunkley Acision Adam van den Hoven Frozen Mountain Integrating

More information

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1 OSI Transport Layer Network Fundamentals Chapter 4 Version 4.0 1 Transport Layer Role and Services Transport layer is responsible for overall end-to-end transfer of application data 2 Transport Layer Role

More information

Different Layers Lecture 21

Different Layers Lecture 21 Different Layers Lecture 21 10/17/2003 Jian Ren 1 The Transport Layer 10/17/2003 Jian Ren 2 Transport Services and Protocols Provide logical communication between app processes running on different hosts

More information

UNIX Network Programming. Overview of Socket API Network Programming Basics

UNIX Network Programming. Overview of Socket API Network Programming Basics UNIX Network Programming Overview of Socket API Network Programming Basics 1 Client-Server Model Client Machine A Network Server Machine B Web browser and server FTP client and server Telnet client and

More information

Socket Programming. CSIS0234A Computer and Communication Networks. Socket Programming in C

Socket Programming. CSIS0234A Computer and Communication Networks. Socket Programming in C 1 CSIS0234A Computer and Communication Networks Socket Programming in C References Beej's Guide to Network Programming Official homepage: http://beej.us/guide/bgnet/ Local mirror http://www.cs.hku.hk/~c0234a/bgnet/

More information

Backends and Databases. Dr. Sarah Abraham

Backends and Databases. Dr. Sarah Abraham Backends and Databases Dr. Sarah Abraham University of Texas at Austin CS329e Fall 2016 What is a Backend? Server and database external to the mobile device Located on remote servers set up by developers

More information

DOWNLOAD OR READ : TCP IP SOCKETS IN C PRACTICAL GUIDE FOR PROGRAMMERS TCP IP SOCKETS IN C BUNDLE PDF EBOOK EPUB MOBI

DOWNLOAD OR READ : TCP IP SOCKETS IN C PRACTICAL GUIDE FOR PROGRAMMERS TCP IP SOCKETS IN C BUNDLE PDF EBOOK EPUB MOBI DOWNLOAD OR READ : TCP IP SOCKETS IN C PRACTICAL GUIDE FOR PROGRAMMERS TCP IP SOCKETS IN C BUNDLE PDF EBOOK EPUB MOBI Page 1 Page 2 tcp ip sockets in c practical guide for programmers tcp ip sockets in

More information

HP Roam - Business Deployment Guide

HP Roam - Business Deployment Guide HP Roam - Business Deployment Guide Copyright 2018 HP Development Company, L.P. January 2019 The information contained herein is subject to change without notice. The only warranties for HP products and

More information

Different Layers Lecture 20

Different Layers Lecture 20 Different Layers Lecture 20 10/15/2003 Jian Ren 1 The Network Layer 10/15/2003 Jian Ren 2 Network Layer Functions Transport packet from sending to receiving hosts Network layer protocols in every host,

More information

PLEASE READ CAREFULLY BEFORE YOU START

PLEASE READ CAREFULLY BEFORE YOU START MIDTERM EXAMINATION #1 NETWORKING CONCEPTS 03-60-367-01 U N I V E R S I T Y O F W I N D S O R - S c h o o l o f C o m p u t e r S c i e n c e Intersession 2009 Question Paper NOTE: Students may take this

More information

Sockets. Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University Embedded Software Lab.

Sockets. Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University  Embedded Software Lab. 1 Sockets Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University http://nyx.skku.ac.kr Internet Connections (1) 2 Connection Clients and servers communicate by sending streams of bytes over

More information

VMware Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments

VMware  Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments VMware Email Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments Workspace ONE UEM v9.5 Have documentation feedback? Submit a Documentation

More information

Computer Network Programming

Computer Network Programming Practical Programming Computer Network Programming Marwan Burelle & David Bouchet david.bouchet.epita@gmail.com 1 Quick Overview 1.IP and Protocol Stack 2.TCP Concepts 3.Client / Server Concepts 4.Socket

More information

CSE 124 Discussion Section Sockets Programming 10/10/17

CSE 124 Discussion Section Sockets Programming 10/10/17 CSE 124 Discussion Section Sockets Programming 10/10/17 Topics What s a socket? Creating a socket Connecting a socket Sending data Receiving data Resolving URLs to IPs Advanced socket options Live code

More information

Christian Tschudin (basierend auf einem Foliensatz von C. Jelger und T. Meyer) Departement Mathematik und Informatik, Universität Basel

Christian Tschudin (basierend auf einem Foliensatz von C. Jelger und T. Meyer) Departement Mathematik und Informatik, Universität Basel Internettechnologien (CS262) Socket Programming in C 4. März 2015 Christian Tschudin (basierend auf einem Foliensatz von C. Jelger und T. Meyer) Departement Mathematik und Informatik, Universität Basel

More information

CS 3516: Computer Networks

CS 3516: Computer Networks Welcome to CS 3516: Prof. Yanhua Li Time: 9:00am 9:50am M, T, R, and F Location: AK219 Fall 2018 A-term 1 Some slides are originally from the course materials of the textbook Computer Networking: A Top

More information

Networked Applications: Sockets. End System: Computer on the Net

Networked Applications: Sockets. End System: Computer on the Net Networked Applications: Sockets Topics Programmer s view of the Internet Sockets interface End System: Computer on the Net Internet Also known as a host 2 Page 1 Clients and Servers Client program Running

More information

CSc 450/550 Computer Networks Network Architectures & Client-Server Model

CSc 450/550 Computer Networks Network Architectures & Client-Server Model CSc 450/550 Computer Networks Network Architectures & Client-Server Model Jianping Pan Summer 2007 5/17/07 CSc 450/550 1 Last lectures So far, nuts and bolts views of the Internet Internet evolution and

More information

Ports under 1024 are often considered special, and usually require special OS privileges to use.

Ports under 1024 are often considered special, and usually require special OS privileges to use. 1 2 Turns out that besides an IP address (used by the IP layer), there is another address that is used by TCP (stream sockets) and, coincidentally, by UDP (datagram sockets). It is the port number. It's

More information

Internet Applications. Dr Steve Gordon ICT, SIIT

Internet Applications. Dr Steve Gordon ICT, SIIT Internet Applications Dr Steve Gordon ICT, SIIT Contents Network Application Models Transport Layer Interface Selected Applications and Services Naming Resources Web Access Email Network Management Other

More information

Networked Applications: Sockets. Goals of Todayʼs Lecture. End System: Computer on the ʻNet. Client-server paradigm End systems Clients and servers

Networked Applications: Sockets. Goals of Todayʼs Lecture. End System: Computer on the ʻNet. Client-server paradigm End systems Clients and servers Networked Applications: Sockets CS 375: Computer Networks Spring 2009 Thomas Bressoud 1 Goals of Todayʼs Lecture Client-server paradigm End systems Clients and servers Sockets and Network Programming Socket

More information

VMware Notification Service v2.0 Installation and Configuration Guide Configure ENSv2 for cloud and on-premises deployments

VMware  Notification Service v2.0 Installation and Configuration Guide Configure ENSv2 for cloud and on-premises deployments VMware Email Notification Service v2.0 Installation and Configuration Guide Configure ENSv2 for cloud and on-premises deployments Workspace ONE UEM v9.4 Have documentation feedback? Submit a Documentation

More information

Cisco StadiumVision Mobile API for Apple ios

Cisco StadiumVision Mobile API for Apple ios CHAPTER 1 Revised: October 31, 2013 This chapter describes the Cisco StadiumVision Mobile SDK Release 1.3 for Apple ios, and contains the following sections: New Features in Cisco StadiumVision Mobile

More information

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E.

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E. UNIX Sockets Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E. Socket and Process Communication application layer User Process Socket transport layer (TCP/UDP) network layer (IP)

More information

VMware Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments

VMware  Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments VMware Email Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments Workspace ONE UEM v9.7 Have documentation feedback? Submit a Documentation

More information

UDP CONNECT TO A SERVER

UDP CONNECT TO A SERVER UDP The User Datagram Protocol Stefan D. Bruda Winter 2018 Very similar to the TCP in terms of API Dissimilar with TCP in terms of innards (and hence programming techniques) Many-to-many communication.

More information

Tutorial on Socket Programming

Tutorial on Socket Programming Tutorial on Socket Programming Computer Networks - CSC 458 Department of Computer Science Hao Wang (Slides are mainly from Seyed Hossein Mortazavi, Monia Ghobadi, and Amin Tootoonchian, ) 1 Outline Client-server

More information

Introduction to Information Science and Technology 2017 Networking II. Sören Schwertfeger 师泽仁

Introduction to Information Science and Technology 2017 Networking II. Sören Schwertfeger 师泽仁 II Sören Schwertfeger 师泽仁 Outline Review Network Layer Routing Transport Layer Applications HTTP Demos Internet: Huge network of networks Billions of hosts (computers) Internet Structure Network Edge:

More information

ios Developer s Guide Version 1.0

ios Developer s Guide Version 1.0 HealthyFROGS ios Developer s Guide ios Developer s Guide Version 1.0 Tuesday May 7, 2013 2012-2013 Computer Science Department, Texas Christian University - All Rights Reserved HealthyFROGS ios Developer

More information

Backends and Databases. Dr. Sarah Abraham

Backends and Databases. Dr. Sarah Abraham Backends and Databases Dr. Sarah Abraham University of Texas at Austin CS329e Fall 2018 What is a Backend? Server and database external to the mobile device Located on remote servers set up by developers

More information

Socket Programming 2007/03/28

Socket Programming 2007/03/28 Socket Programming 2007/03/28 Reference W. Richard Stevens, Unix Network Programming 2/e Volume 1,1998 James F. Kurose and Keith W. Ross, "Computer Networks: A Top-Down Approach Featuring the Internet

More information

4. The transport layer

4. The transport layer 4.1 The port number One of the most important information contained in the header of a segment are the destination and the source port numbers. The port numbers are necessary to identify the application

More information

Socket Programming for TCP and UDP

Socket Programming for TCP and UDP CSCI4430 Data Communication and Computer Networks Socket Programming for TCP and UDP ZHANG, Mi Jan. 19, 2017 Outline Socket Programming for TCP Introduction What is TCP What is socket TCP socket programming

More information

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 16, 2008 Agenda 1 Introduction and Overview Introduction 2 Socket

More information

The User Datagram Protocol

The User Datagram Protocol The User Datagram Protocol Stefan D. Bruda Winter 2018 UDP Very similar to the TCP in terms of API Dissimilar with TCP in terms of innards (and hence programming techniques) Many-to-many communication.

More information

VMware Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments

VMware  Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments VMware Email Notification Service v2.0 Installation and Configuration Guide Configure ENS2 for cloud and on-premises deployments Workspace ONE UEM v1810 Have documentation feedback? Submit a Documentation

More information

Administrator's Guide

Administrator's Guide Administrator's Guide Contents Administrator's Guide... 7 Using Web Config Network Configuration Software... 8 About Web Config... 8 Accessing Web Config... 8 Changing the Administrator Password in Web

More information

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 5, 2009 Agenda 1 Introduction and Overview 2 Socket Programming 3

More information

CSC209H Lecture 9. Dan Zingaro. March 11, 2015

CSC209H Lecture 9. Dan Zingaro. March 11, 2015 CSC209H Lecture 9 Dan Zingaro March 11, 2015 Socket Programming (Kerrisk Ch 56, 57, 59) Pipes and signals are only useful for processes communicating on the same machine Sockets are a general interprocess

More information