SlideShare a Scribd company logo
APPLE BONJOUR,
                                  LET’S TALK!




 Nicholas Valbusa - @squallstar
 Intesys Web Agency



Thursday, May 24, 12
Thursday, May 24, 12
Few words about me




Thursday, May 24, 12
Few words about me

                           Nicholas Valbusa
                           @squallstar




Thursday, May 24, 12
Few words about me

                           Nicholas Valbusa
                           @squallstar


                           Web Developer since 2004




Thursday, May 24, 12
Few words about me

                           Nicholas Valbusa
                           @squallstar


                           Web Developer since 2004

                           Mobile Developer since 2010




Thursday, May 24, 12
Few words about me

                           Nicholas Valbusa
                           @squallstar


                           Web Developer since 2004

                           Mobile Developer since 2010
                           WHYMCA 2011: Webkit meets Native development




Thursday, May 24, 12
Thursday, May 24, 12
Intesys è una Web Agency Innovativa
                              nata nel 1995 a Verona




Thursday, May 24, 12
Intesys è una Web Agency Innovativa
                               nata nel 1995 a Verona



                       Un team di 90 specialisti divisi in 4 aree




Thursday, May 24, 12
Intesys è una Web Agency Innovativa
                               nata nel 1995 a Verona



                       Un team di 90 specialisti divisi in 4 aree




Thursday, May 24, 12
We’ll talk about




Thursday, May 24, 12
We’ll talk about




Thursday, May 24, 12
We’ll talk about




Thursday, May 24, 12
We’ll talk about


                       • TCP/IP




Thursday, May 24, 12
We’ll talk about


                       • TCP/IP
                       • Apple Bonjour, uPNP




Thursday, May 24, 12
We’ll talk about


                       • TCP/IP
                       • Apple Bonjour, uPNP
                       • Socket, Stream, Buffers




Thursday, May 24, 12
We’ll talk about


                       • TCP/IP
                       • Apple Bonjour, uPNP
                       • Socket, Stream, Buffers
                       • Create and publish a server




Thursday, May 24, 12
We’ll talk about


                       • TCP/IP
                       • Apple Bonjour, uPNP
                       • Socket, Stream, Buffers
                       • Create and publish a server
                       • Join a server




Thursday, May 24, 12
We’ll talk about


                       • TCP/IP
                       • Apple Bonjour, uPNP
                       • Socket, Stream, Buffers
                       • Create and publish a server
                       • Join a server
                       • Network messages




Thursday, May 24, 12
We’ll talk about


                       • TCP/IP
                       • Apple Bonjour, uPNP
                       • Socket, Stream, Buffers
                       • Create and publish a server
                       • Join a server
                       • Network messages
                       • Other...



Thursday, May 24, 12
We’ll see




Thursday, May 24, 12
We’ll see

                       • A screencast native application




Thursday, May 24, 12
We’ll see

                       • A screencast native application
                       • Something like chats




Thursday, May 24, 12
We’ll see

                       • A screencast native application
                       • Something like chats
                       • Where server can send images and other things




Thursday, May 24, 12
We’ll see

                       • A screencast native application
                       • Something like chats
                       • Where server can send images and other things


                        Follow the talk from your iPad using the same app
                        that we’re going to make




                                                           iCast




Thursday, May 24, 12
iCast




Thursday, May 24, 12
iCast




Thursday, May 24, 12
iCast




Thursday, May 24, 12
Thursday, May 24, 12
“Once upon a time”




Thursday, May 24, 12
“Once upon a time”

                            Apple Talk




Thursday, May 24, 12
“Once upon a time”

                                    Apple Talk

                       • Protocollo usato nelle reti Macintosh




Thursday, May 24, 12
“Once upon a time”

                                    Apple Talk

                       • Protocollo usato nelle reti Macintosh
                       • Condivisione di file e stampanti




Thursday, May 24, 12
“Once upon a time”

                                    Apple Talk

                       • Protocollo usato nelle reti Macintosh
                       • Condivisione di file e stampanti
                       • Uno dei primi sistemi plug-n-play




Thursday, May 24, 12
Thursday, May 24, 12
“things changes”




Thursday, May 24, 12
“things changes”

                           TCP/IP




Thursday, May 24, 12
“things changes”

                           TCP/IP

       • Negli anni novanta, con la diffusione del TCP/IP
         Apple dismesse AppleTalk




Thursday, May 24, 12
“things changes”

                           TCP/IP

       • Negli anni novanta, con la diffusione del TCP/IP
         Apple dismesse AppleTalk
       • Finalmente i Mac potevano connettersi con
         altri sistemi operativi




Thursday, May 24, 12
Thursday, May 24, 12
Zeroconf
                        DHCP DNS




Thursday, May 24, 12
Zeroconf
                            DHCP DNS




            “A set of techniques that automatically
            creates a usable IP network without manual
            operator intervention”




Thursday, May 24, 12
Thursday, May 24, 12
Bonjour




Thursday, May 24, 12
Bonjour
                           L’implementazione Apple
                       di “Zero configuration network”




Thursday, May 24, 12
Bonjour
                           L’implementazione Apple
                       di “Zero configuration network”

                               “It just works”




Thursday, May 24, 12
Bonjour
                           L’implementazione Apple
                       di “Zero configuration network”

                               “It just works”

                                        • mDNS + DNS Service discovery




Thursday, May 24, 12
Bonjour
                           L’implementazione Apple
                       di “Zero configuration network”

                               “It just works”

                                        • mDNS + DNS Service discovery
                                        • Address assignment




Thursday, May 24, 12
Bonjour
                           L’implementazione Apple
                       di “Zero configuration network”

                               “It just works”

                                        • mDNS + DNS Service discovery
                                        • Address assignment
                                        • Name resolution




Thursday, May 24, 12
Bonjour




Thursday, May 24, 12
Bonjour

                • Built-in con OSX e iOS.




Thursday, May 24, 12
Bonjour

                • Built-in con OSX e iOS.
                • Installabile su Windows




Thursday, May 24, 12
Bonjour

                • Built-in con OSX e iOS.
                • Installabile su Windows
                • Incluso in Safari e iTunes.




Thursday, May 24, 12
Bonjour

                • Built-in con OSX e iOS.
                • Installabile su Windows
                • Incluso in Safari e iTunes.
                • Incluso nella Creative Suite 3 di Adobe




Thursday, May 24, 12
Thursday, May 24, 12
Who uses it




Thursday, May 24, 12
Who uses it
                       • iTunes finds shared music




Thursday, May 24, 12
Who uses it
                       • iTunes finds shared music
                       • iPhotos finds shared photos




Thursday, May 24, 12
Who uses it
                       • iTunes finds shared music
                       • iPhotos finds shared photos
                       • iChat, Skype, Adium




Thursday, May 24, 12
Who uses it
                       •   iTunes finds shared music
                       •   iPhotos finds shared photos
                       •   iChat, Skype, Adium
                       •   Adobe Creative Suite 3+




Thursday, May 24, 12
Who uses it
                       •   iTunes finds shared music
                       •   iPhotos finds shared photos
                       •   iChat, Skype, Adium
                       •   Adobe Creative Suite 3+
                       •   Things, Omnifocus




Thursday, May 24, 12
Who uses it
                       •   iTunes finds shared music
                       •   iPhotos finds shared photos
                       •   iChat, Skype, Adium
                       •   Adobe Creative Suite 3+
                       •   Things, Omnifocus
                       •   Cyberduck, Coda, SubEthaEdit




Thursday, May 24, 12
Who uses it
                       •   iTunes finds shared music
                       •   iPhotos finds shared photos
                       •   iChat, Skype, Adium
                       •   Adobe Creative Suite 3+
                       •   Things, Omnifocus
                       •   Cyberduck, Coda, SubEthaEdit
                       •   PostgreSQL




Thursday, May 24, 12
Who uses it
                       •   iTunes finds shared music
                       •   iPhotos finds shared photos
                       •   iChat, Skype, Adium
                       •   Adobe Creative Suite 3+
                       •   Things, Omnifocus
                       •   Cyberduck, Coda, SubEthaEdit
                       •   PostgreSQL
                       •   All uPNP-enabled devices


Thursday, May 24, 12
Thursday, May 24, 12
Who can also use it




Thursday, May 24, 12
Who can also use it




Thursday, May 24, 12
Who can also use it




                       Using “jmDNS”, a Java implementation
                       of multi-cast DNS for LAN service registration/discovery.




Thursday, May 24, 12
Thursday, May 24, 12
uPNP
                       Universal plug-n-play




Thursday, May 24, 12
uPNP
                              Universal plug-n-play


                 • It’s just another implementation of Zeroconf




Thursday, May 24, 12
uPNP
                              Universal plug-n-play


                 • It’s just another implementation of Zeroconf
                 • Media servers, Consoles, DLNA servers...




Thursday, May 24, 12
uPNP
                              Universal plug-n-play


                 • It’s just another implementation of Zeroconf
                 • Media servers, Consoles, DLNA servers...
                 • No authentication




Thursday, May 24, 12
uPNP
                              Universal plug-n-play


                 • It’s just another implementation of Zeroconf
                 • Media servers, Consoles, DLNA servers...
                 • No authentication
                 • No mDNS




Thursday, May 24, 12
Thursday, May 24, 12
Bonjour: Service Publication




Thursday, May 24, 12
Bonjour: Service Publication




Thursday, May 24, 12
Thursday, May 24, 12
Bonjour: Service Publication




Thursday, May 24, 12
Bonjour: Service Publication




Thursday, May 24, 12
Thursday, May 24, 12
Bonjour: Query for services




Thursday, May 24, 12
Bonjour: Query for services




Thursday, May 24, 12
Thursday, May 24, 12
Bonjour: Connect




Thursday, May 24, 12
Bonjour: Connect




Thursday, May 24, 12
Thursday, May 24, 12
Sockets vs Streams




Thursday, May 24, 12
Sockets vs Streams

                       • Socket: unique communication
                         endpoint on the network




Thursday, May 24, 12
Sockets vs Streams

                       • Socket: unique communication
                         endpoint on the network

                       • Stream: one-way channel through
                         which data is transmitted serially




Thursday, May 24, 12
Thursday, May 24, 12
We will use




Thursday, May 24, 12
We will use

                       • Stream sockets that are paired up
                         to allow our app to send data over
                         network using TCP/IP




Thursday, May 24, 12
We will use

                       • Stream sockets that are paired up
                         to allow our app to send data over
                         network using TCP/IP

                       • Asynchronous, non-blocking
                         operations




Thursday, May 24, 12
Thursday, May 24, 12
3 Networking Classes




Thursday, May 24, 12
3 Networking Classes
                       Server class:




Thursday, May 24, 12
3 Networking Classes
                       Server class:
                         • Creates a server




Thursday, May 24, 12
3 Networking Classes
                       Server class:
                         • Creates a server
                         • Announces the server via Bonjour




Thursday, May 24, 12
3 Networking Classes
                       Server class:
                         • Creates a server
                         • Announces the server via Bonjour

                       Connection class:




Thursday, May 24, 12
3 Networking Classes
                       Server class:
                         • Creates a server
                         • Announces the server via Bonjour

                       Connection class:
                         • Resolves Bonjour Services




Thursday, May 24, 12
3 Networking Classes
                       Server class:
                         • Creates a server
                         • Announces the server via Bonjour

                       Connection class:
                         • Resolves Bonjour Services
                         • Establishes connections to other servers




Thursday, May 24, 12
3 Networking Classes
                       Server class:
                         • Creates a server
                         • Announces the server via Bonjour

                       Connection class:
                         • Resolves Bonjour Services
                         • Establishes connections to other servers
                         • Exchanges data via socket streams




Thursday, May 24, 12
3 Networking Classes
                       Server class:
                         • Creates a server
                         • Announces the server via Bonjour

                       Connection class:
                         • Resolves Bonjour Services
                         • Establishes connections to other servers
                         • Exchanges data via socket streams

                       Server Browser class:




Thursday, May 24, 12
3 Networking Classes
                       Server class:
                         • Creates a server
                         • Announces the server via Bonjour

                       Connection class:
                         • Resolves Bonjour Services
                         • Establishes connections to other servers
                         • Exchanges data via socket streams

                       Server Browser class:
                         • Browses for other servers via Bonjour



Thursday, May 24, 12
Thursday, May 24, 12
Application layers




Thursday, May 24, 12
Application layers




Thursday, May 24, 12
Application layers




Thursday, May 24, 12
Application layers




Thursday, May 24, 12
Thursday, May 24, 12
Down the Connection class




Thursday, May 24, 12
Down the Connection class




                       2 stream sockets (one for writing, one for reading)
                        2 data buffers (one for each socket stream)


Thursday, May 24, 12
Thursday, May 24, 12
Network messages




Thursday, May 24, 12
Network messages

          How do we separate network messages from one another?




Thursday, May 24, 12
Network messages

          How do we separate network messages from one another?

           3 different ways:




Thursday, May 24, 12
Network messages

          How do we separate network messages from one another?

           3 different ways:
              1) Make all messages have the same length




Thursday, May 24, 12
Network messages

          How do we separate network messages from one another?

           3 different ways:
              1) Make all messages have the same length
              2) Append a marker to each message




Thursday, May 24, 12
Network messages

          How do we separate network messages from one another?

           3 different ways:
              1) Make all messages have the same length
              2) Append a marker to each message
              3) Send some kind of header with some info about how long the
                 message is




Thursday, May 24, 12
Network messages

          How do we separate network messages from one another?

           3 different ways:
              1) Make all messages have the same length
              2) Append a marker to each message
              3) Send some kind of header with some info about how long the
                 message is




Thursday, May 24, 12
Thursday, May 24, 12
3) Send some kind of header...




Thursday, May 24, 12
3) Send some kind of header...


                       Writing messages




Thursday, May 24, 12
3) Send some kind of header...


                                 Writing messages

               • Convert an object into a byte array and measure its length




Thursday, May 24, 12
3) Send some kind of header...


                                  Writing messages

               • Convert an object into a byte array and measure its length
               • Write the integer (4 bytes) that represents the length of our byte
                 array to the stream




Thursday, May 24, 12
3) Send some kind of header...


                                  Writing messages

               • Convert an object into a byte array and measure its length
               • Write the integer (4 bytes) that represents the length of our byte
                 array to the stream
               • Write the actual byte array to the stream




Thursday, May 24, 12
Reading messages




Thursday, May 24, 12
Reading messages




               • Read first 4 bytes and interpret those as an integer called “x”




Thursday, May 24, 12
Reading messages




               • Read first 4 bytes and interpret those as an integer called “x”

               • Read “x” number of bytes.
                       (stop when enough data has been received)




Thursday, May 24, 12
Reading messages




               • Read first 4 bytes and interpret those as an integer called “x”

               • Read “x” number of bytes.
                       (stop when enough data has been received)


               • Turn received sequence of bytes back into an object.




Thursday, May 24, 12
Thursday, May 24, 12
It’s time!




Thursday, May 24, 12
Thursday, May 24, 12
Frameworks




Thursday, May 24, 12
Frameworks

                       • Low level: BSD socket lib




Thursday, May 24, 12
Frameworks

                       • Low level: BSD socket lib




Thursday, May 24, 12
Frameworks

                       • Low level: BSD socket lib

                       • High level: CFNetwork




Thursday, May 24, 12
Frameworks

                       • Low level: BSD socket lib

                       • High level: CFNetwork

                       • Bonjour iOS API: NSNetServices,
                         CFNetServices




Thursday, May 24, 12
Thursday, May 24, 12
Creating a server




Thursday, May 24, 12
Creating a server

                 We first create a stream
                 socket that will listen for
                       connections




Thursday, May 24, 12
Creating a server

                 We first create a stream
                 socket that will listen for
                       connections

          CFSocketRef listeningSocket;




Thursday, May 24, 12
Creating a server

                 We first create a stream
                 socket that will listen for
                       connections

          CFSocketRef listeningSocket;


                       using port number 0




Thursday, May 24, 12
Creating a server

                 We first create a stream
                 socket that will listen for
                       connections

          CFSocketRef listeningSocket;


                       using port number 0


                       zero???? O_o



Thursday, May 24, 12
Thursday, May 24, 12
Let’s publish the service




Thursday, May 24, 12
Let’s publish the service




Thursday, May 24, 12
Thursday, May 24, 12
Services/Servers Browser




Thursday, May 24, 12
Services/Servers Browser




Thursday, May 24, 12
Thursday, May 24, 12
Found!




Thursday, May 24, 12
Found!




Thursday, May 24, 12
Thursday, May 24, 12
Displaying servers list




Thursday, May 24, 12
Displaying servers list




Thursday, May 24, 12
Thursday, May 24, 12
Please let me join




Thursday, May 24, 12
Please let me join




Thursday, May 24, 12
Please let me join




Thursday, May 24, 12
Please let me join




Thursday, May 24, 12
Please let me join




Thursday, May 24, 12
Thursday, May 24, 12
The server receives the “request”




Thursday, May 24, 12
The server receives the “request”




Thursday, May 24, 12
Thursday, May 24, 12
The server welcomes you




Thursday, May 24, 12
The server welcomes you




Thursday, May 24, 12
The server welcomes you




Thursday, May 24, 12
Thursday, May 24, 12
The client receives the stream




Thursday, May 24, 12
The client receives the stream




Thursday, May 24, 12
Thursday, May 24, 12
Recap




Thursday, May 24, 12
Recap
          • Apple Talk, TCP/IP




Thursday, May 24, 12
Recap
          • Apple Talk, TCP/IP
          • Bonjour flow cycle, uPNP




Thursday, May 24, 12
Recap
          • Apple Talk, TCP/IP
          • Bonjour flow cycle, uPNP
          • Application layers, Socket, Stream, Buffers




Thursday, May 24, 12
Recap
          • Apple Talk, TCP/IP
          • Bonjour flow cycle, uPNP
          • Application layers, Socket, Stream, Buffers
          • Write/Read Network messages




Thursday, May 24, 12
Recap
          • Apple Talk, TCP/IP
          • Bonjour flow cycle, uPNP
          • Application layers, Socket, Stream, Buffers
          • Write/Read Network messages
          • Create and publish a server




Thursday, May 24, 12
Recap
          • Apple Talk, TCP/IP
          • Bonjour flow cycle, uPNP
          • Application layers, Socket, Stream, Buffers
          • Write/Read Network messages
          • Create and publish a server
          • Join a server




Thursday, May 24, 12
Recap
          • Apple Talk, TCP/IP
          • Bonjour flow cycle, uPNP
          • Application layers, Socket, Stream, Buffers
          • Write/Read Network messages
          • Create and publish a server
          • Join a server
          • Interaction between the client and the server




Thursday, May 24, 12
Recap
          • Apple Talk, TCP/IP
          • Bonjour flow cycle, uPNP
          • Application layers, Socket, Stream, Buffers
          • Write/Read Network messages
          • Create and publish a server
          • Join a server
          • Interaction between the client and the server

          • One more thing: server broadcasts messages to connected clients




Thursday, May 24, 12
Thursday, May 24, 12
Thank you.
                       Any questions?

                       Nicholas Valbusa
                       @squallstar



                       Intesys - @Intesys_IT - www.intesys.it




Thursday, May 24, 12

More Related Content

Similar to Apple Bonjour: Let's Talk!

Whats New In Roller5
Whats New In Roller5Whats New In Roller5
Whats New In Roller5
David M. Johnson
 
Cloud Foundry the Open PaaS - OpenTour Austin Keynote
Cloud Foundry the Open PaaS - OpenTour Austin KeynoteCloud Foundry the Open PaaS - OpenTour Austin Keynote
Cloud Foundry the Open PaaS - OpenTour Austin KeynotePatrick Chanezon
 
Socket io - JSZurich
Socket io - JSZurichSocket io - JSZurich
Socket io - JSZurich
streunerlein
 
The seven more deadly sins of microservices final
The seven more deadly sins of microservices finalThe seven more deadly sins of microservices final
The seven more deadly sins of microservices final
Haufe-Lexware GmbH & Co KG
 
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
OpenCredo
 
Canary Analyze All The Things: How We Learned to Keep Calm and Release Often
Canary Analyze All The Things: How We Learned to Keep Calm and Release OftenCanary Analyze All The Things: How We Learned to Keep Calm and Release Often
Canary Analyze All The Things: How We Learned to Keep Calm and Release Often
C4Media
 
Berlin.JS Meetup
Berlin.JS MeetupBerlin.JS Meetup
Berlin.JS Meetup
Adam Christian
 
OpenStack in the Enterprise - NJ VMUG June 9, 2015 - Melissa Palmer
OpenStack in the Enterprise - NJ VMUG June 9, 2015 - Melissa PalmerOpenStack in the Enterprise - NJ VMUG June 9, 2015 - Melissa Palmer
OpenStack in the Enterprise - NJ VMUG June 9, 2015 - Melissa Palmer
vmiss33
 
E novance public cloud - openstackisrael-2013
E novance   public cloud - openstackisrael-2013E novance   public cloud - openstackisrael-2013
E novance public cloud - openstackisrael-2013Cloud Native Day Tel Aviv
 
We invented the Web. 20 years later we got Drupal.
We invented the Web. 20 years later we got Drupal.We invented the Web. 20 years later we got Drupal.
We invented the Web. 20 years later we got Drupal.
nbocquetlinalis
 
Tech Jam 2015: O'Reilly Media
Tech Jam 2015: O'Reilly MediaTech Jam 2015: O'Reilly Media
Tech Jam 2015: O'Reilly Media
US-Ignite
 
Big Data and OpenStack, a Love Story: Michael Still, Rackspace
Big Data and OpenStack, a Love Story: Michael Still, RackspaceBig Data and OpenStack, a Love Story: Michael Still, Rackspace
Big Data and OpenStack, a Love Story: Michael Still, Rackspace
OpenStack
 
Global impact of OpenStack
Global impact of OpenStack   Global impact of OpenStack
Global impact of OpenStack openstackindia
 
Welcome to Consuming Linked Data tutorial WWW2010
Welcome to Consuming Linked Data tutorial WWW2010Welcome to Consuming Linked Data tutorial WWW2010
Welcome to Consuming Linked Data tutorial WWW2010
Juan Sequeda
 
NoSql _ MongoDB - Italian Market copy
NoSql _ MongoDB - Italian Market copyNoSql _ MongoDB - Italian Market copy
NoSql _ MongoDB - Italian Market copy
MongoDB
 
Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?
Colin Charles
 
Openstack In Real Life
Openstack In Real LifeOpenstack In Real Life
Openstack In Real Life
Paul Guth
 
“Mobile Choices” and Library Anywhere (CILIP)
“Mobile Choices” and Library Anywhere (CILIP)“Mobile Choices” and Library Anywhere (CILIP)
“Mobile Choices” and Library Anywhere (CILIP)Tim Spalding
 

Similar to Apple Bonjour: Let's Talk! (20)

Whats New In Roller5
Whats New In Roller5Whats New In Roller5
Whats New In Roller5
 
Cloud Foundry the Open PaaS - OpenTour Austin Keynote
Cloud Foundry the Open PaaS - OpenTour Austin KeynoteCloud Foundry the Open PaaS - OpenTour Austin Keynote
Cloud Foundry the Open PaaS - OpenTour Austin Keynote
 
Taming the rabbit
Taming the rabbitTaming the rabbit
Taming the rabbit
 
Socket io - JSZurich
Socket io - JSZurichSocket io - JSZurich
Socket io - JSZurich
 
The seven more deadly sins of microservices final
The seven more deadly sins of microservices finalThe seven more deadly sins of microservices final
The seven more deadly sins of microservices final
 
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
 
Canary Analyze All The Things: How We Learned to Keep Calm and Release Often
Canary Analyze All The Things: How We Learned to Keep Calm and Release OftenCanary Analyze All The Things: How We Learned to Keep Calm and Release Often
Canary Analyze All The Things: How We Learned to Keep Calm and Release Often
 
Windows 8
Windows 8Windows 8
Windows 8
 
Berlin.JS Meetup
Berlin.JS MeetupBerlin.JS Meetup
Berlin.JS Meetup
 
OpenStack in the Enterprise - NJ VMUG June 9, 2015 - Melissa Palmer
OpenStack in the Enterprise - NJ VMUG June 9, 2015 - Melissa PalmerOpenStack in the Enterprise - NJ VMUG June 9, 2015 - Melissa Palmer
OpenStack in the Enterprise - NJ VMUG June 9, 2015 - Melissa Palmer
 
E novance public cloud - openstackisrael-2013
E novance   public cloud - openstackisrael-2013E novance   public cloud - openstackisrael-2013
E novance public cloud - openstackisrael-2013
 
We invented the Web. 20 years later we got Drupal.
We invented the Web. 20 years later we got Drupal.We invented the Web. 20 years later we got Drupal.
We invented the Web. 20 years later we got Drupal.
 
Tech Jam 2015: O'Reilly Media
Tech Jam 2015: O'Reilly MediaTech Jam 2015: O'Reilly Media
Tech Jam 2015: O'Reilly Media
 
Big Data and OpenStack, a Love Story: Michael Still, Rackspace
Big Data and OpenStack, a Love Story: Michael Still, RackspaceBig Data and OpenStack, a Love Story: Michael Still, Rackspace
Big Data and OpenStack, a Love Story: Michael Still, Rackspace
 
Global impact of OpenStack
Global impact of OpenStack   Global impact of OpenStack
Global impact of OpenStack
 
Welcome to Consuming Linked Data tutorial WWW2010
Welcome to Consuming Linked Data tutorial WWW2010Welcome to Consuming Linked Data tutorial WWW2010
Welcome to Consuming Linked Data tutorial WWW2010
 
NoSql _ MongoDB - Italian Market copy
NoSql _ MongoDB - Italian Market copyNoSql _ MongoDB - Italian Market copy
NoSql _ MongoDB - Italian Market copy
 
Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?
 
Openstack In Real Life
Openstack In Real LifeOpenstack In Real Life
Openstack In Real Life
 
“Mobile Choices” and Library Anywhere (CILIP)
“Mobile Choices” and Library Anywhere (CILIP)“Mobile Choices” and Library Anywhere (CILIP)
“Mobile Choices” and Library Anywhere (CILIP)
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 

Apple Bonjour: Let's Talk!

  • 1. APPLE BONJOUR, LET’S TALK! Nicholas Valbusa - @squallstar Intesys Web Agency Thursday, May 24, 12
  • 3. Few words about me Thursday, May 24, 12
  • 4. Few words about me Nicholas Valbusa @squallstar Thursday, May 24, 12
  • 5. Few words about me Nicholas Valbusa @squallstar Web Developer since 2004 Thursday, May 24, 12
  • 6. Few words about me Nicholas Valbusa @squallstar Web Developer since 2004 Mobile Developer since 2010 Thursday, May 24, 12
  • 7. Few words about me Nicholas Valbusa @squallstar Web Developer since 2004 Mobile Developer since 2010 WHYMCA 2011: Webkit meets Native development Thursday, May 24, 12
  • 9. Intesys è una Web Agency Innovativa nata nel 1995 a Verona Thursday, May 24, 12
  • 10. Intesys è una Web Agency Innovativa nata nel 1995 a Verona Un team di 90 specialisti divisi in 4 aree Thursday, May 24, 12
  • 11. Intesys è una Web Agency Innovativa nata nel 1995 a Verona Un team di 90 specialisti divisi in 4 aree Thursday, May 24, 12
  • 15. We’ll talk about • TCP/IP Thursday, May 24, 12
  • 16. We’ll talk about • TCP/IP • Apple Bonjour, uPNP Thursday, May 24, 12
  • 17. We’ll talk about • TCP/IP • Apple Bonjour, uPNP • Socket, Stream, Buffers Thursday, May 24, 12
  • 18. We’ll talk about • TCP/IP • Apple Bonjour, uPNP • Socket, Stream, Buffers • Create and publish a server Thursday, May 24, 12
  • 19. We’ll talk about • TCP/IP • Apple Bonjour, uPNP • Socket, Stream, Buffers • Create and publish a server • Join a server Thursday, May 24, 12
  • 20. We’ll talk about • TCP/IP • Apple Bonjour, uPNP • Socket, Stream, Buffers • Create and publish a server • Join a server • Network messages Thursday, May 24, 12
  • 21. We’ll talk about • TCP/IP • Apple Bonjour, uPNP • Socket, Stream, Buffers • Create and publish a server • Join a server • Network messages • Other... Thursday, May 24, 12
  • 23. We’ll see • A screencast native application Thursday, May 24, 12
  • 24. We’ll see • A screencast native application • Something like chats Thursday, May 24, 12
  • 25. We’ll see • A screencast native application • Something like chats • Where server can send images and other things Thursday, May 24, 12
  • 26. We’ll see • A screencast native application • Something like chats • Where server can send images and other things Follow the talk from your iPad using the same app that we’re going to make iCast Thursday, May 24, 12
  • 31. “Once upon a time” Thursday, May 24, 12
  • 32. “Once upon a time” Apple Talk Thursday, May 24, 12
  • 33. “Once upon a time” Apple Talk • Protocollo usato nelle reti Macintosh Thursday, May 24, 12
  • 34. “Once upon a time” Apple Talk • Protocollo usato nelle reti Macintosh • Condivisione di file e stampanti Thursday, May 24, 12
  • 35. “Once upon a time” Apple Talk • Protocollo usato nelle reti Macintosh • Condivisione di file e stampanti • Uno dei primi sistemi plug-n-play Thursday, May 24, 12
  • 38. “things changes” TCP/IP Thursday, May 24, 12
  • 39. “things changes” TCP/IP • Negli anni novanta, con la diffusione del TCP/IP Apple dismesse AppleTalk Thursday, May 24, 12
  • 40. “things changes” TCP/IP • Negli anni novanta, con la diffusione del TCP/IP Apple dismesse AppleTalk • Finalmente i Mac potevano connettersi con altri sistemi operativi Thursday, May 24, 12
  • 42. Zeroconf DHCP DNS Thursday, May 24, 12
  • 43. Zeroconf DHCP DNS “A set of techniques that automatically creates a usable IP network without manual operator intervention” Thursday, May 24, 12
  • 46. Bonjour L’implementazione Apple di “Zero configuration network” Thursday, May 24, 12
  • 47. Bonjour L’implementazione Apple di “Zero configuration network” “It just works” Thursday, May 24, 12
  • 48. Bonjour L’implementazione Apple di “Zero configuration network” “It just works” • mDNS + DNS Service discovery Thursday, May 24, 12
  • 49. Bonjour L’implementazione Apple di “Zero configuration network” “It just works” • mDNS + DNS Service discovery • Address assignment Thursday, May 24, 12
  • 50. Bonjour L’implementazione Apple di “Zero configuration network” “It just works” • mDNS + DNS Service discovery • Address assignment • Name resolution Thursday, May 24, 12
  • 52. Bonjour • Built-in con OSX e iOS. Thursday, May 24, 12
  • 53. Bonjour • Built-in con OSX e iOS. • Installabile su Windows Thursday, May 24, 12
  • 54. Bonjour • Built-in con OSX e iOS. • Installabile su Windows • Incluso in Safari e iTunes. Thursday, May 24, 12
  • 55. Bonjour • Built-in con OSX e iOS. • Installabile su Windows • Incluso in Safari e iTunes. • Incluso nella Creative Suite 3 di Adobe Thursday, May 24, 12
  • 57. Who uses it Thursday, May 24, 12
  • 58. Who uses it • iTunes finds shared music Thursday, May 24, 12
  • 59. Who uses it • iTunes finds shared music • iPhotos finds shared photos Thursday, May 24, 12
  • 60. Who uses it • iTunes finds shared music • iPhotos finds shared photos • iChat, Skype, Adium Thursday, May 24, 12
  • 61. Who uses it • iTunes finds shared music • iPhotos finds shared photos • iChat, Skype, Adium • Adobe Creative Suite 3+ Thursday, May 24, 12
  • 62. Who uses it • iTunes finds shared music • iPhotos finds shared photos • iChat, Skype, Adium • Adobe Creative Suite 3+ • Things, Omnifocus Thursday, May 24, 12
  • 63. Who uses it • iTunes finds shared music • iPhotos finds shared photos • iChat, Skype, Adium • Adobe Creative Suite 3+ • Things, Omnifocus • Cyberduck, Coda, SubEthaEdit Thursday, May 24, 12
  • 64. Who uses it • iTunes finds shared music • iPhotos finds shared photos • iChat, Skype, Adium • Adobe Creative Suite 3+ • Things, Omnifocus • Cyberduck, Coda, SubEthaEdit • PostgreSQL Thursday, May 24, 12
  • 65. Who uses it • iTunes finds shared music • iPhotos finds shared photos • iChat, Skype, Adium • Adobe Creative Suite 3+ • Things, Omnifocus • Cyberduck, Coda, SubEthaEdit • PostgreSQL • All uPNP-enabled devices Thursday, May 24, 12
  • 67. Who can also use it Thursday, May 24, 12
  • 68. Who can also use it Thursday, May 24, 12
  • 69. Who can also use it Using “jmDNS”, a Java implementation of multi-cast DNS for LAN service registration/discovery. Thursday, May 24, 12
  • 71. uPNP Universal plug-n-play Thursday, May 24, 12
  • 72. uPNP Universal plug-n-play • It’s just another implementation of Zeroconf Thursday, May 24, 12
  • 73. uPNP Universal plug-n-play • It’s just another implementation of Zeroconf • Media servers, Consoles, DLNA servers... Thursday, May 24, 12
  • 74. uPNP Universal plug-n-play • It’s just another implementation of Zeroconf • Media servers, Consoles, DLNA servers... • No authentication Thursday, May 24, 12
  • 75. uPNP Universal plug-n-play • It’s just another implementation of Zeroconf • Media servers, Consoles, DLNA servers... • No authentication • No mDNS Thursday, May 24, 12
  • 83. Bonjour: Query for services Thursday, May 24, 12
  • 84. Bonjour: Query for services Thursday, May 24, 12
  • 90. Sockets vs Streams • Socket: unique communication endpoint on the network Thursday, May 24, 12
  • 91. Sockets vs Streams • Socket: unique communication endpoint on the network • Stream: one-way channel through which data is transmitted serially Thursday, May 24, 12
  • 93. We will use Thursday, May 24, 12
  • 94. We will use • Stream sockets that are paired up to allow our app to send data over network using TCP/IP Thursday, May 24, 12
  • 95. We will use • Stream sockets that are paired up to allow our app to send data over network using TCP/IP • Asynchronous, non-blocking operations Thursday, May 24, 12
  • 98. 3 Networking Classes Server class: Thursday, May 24, 12
  • 99. 3 Networking Classes Server class: • Creates a server Thursday, May 24, 12
  • 100. 3 Networking Classes Server class: • Creates a server • Announces the server via Bonjour Thursday, May 24, 12
  • 101. 3 Networking Classes Server class: • Creates a server • Announces the server via Bonjour Connection class: Thursday, May 24, 12
  • 102. 3 Networking Classes Server class: • Creates a server • Announces the server via Bonjour Connection class: • Resolves Bonjour Services Thursday, May 24, 12
  • 103. 3 Networking Classes Server class: • Creates a server • Announces the server via Bonjour Connection class: • Resolves Bonjour Services • Establishes connections to other servers Thursday, May 24, 12
  • 104. 3 Networking Classes Server class: • Creates a server • Announces the server via Bonjour Connection class: • Resolves Bonjour Services • Establishes connections to other servers • Exchanges data via socket streams Thursday, May 24, 12
  • 105. 3 Networking Classes Server class: • Creates a server • Announces the server via Bonjour Connection class: • Resolves Bonjour Services • Establishes connections to other servers • Exchanges data via socket streams Server Browser class: Thursday, May 24, 12
  • 106. 3 Networking Classes Server class: • Creates a server • Announces the server via Bonjour Connection class: • Resolves Bonjour Services • Establishes connections to other servers • Exchanges data via socket streams Server Browser class: • Browses for other servers via Bonjour Thursday, May 24, 12
  • 113. Down the Connection class Thursday, May 24, 12
  • 114. Down the Connection class 2 stream sockets (one for writing, one for reading) 2 data buffers (one for each socket stream) Thursday, May 24, 12
  • 117. Network messages How do we separate network messages from one another? Thursday, May 24, 12
  • 118. Network messages How do we separate network messages from one another? 3 different ways: Thursday, May 24, 12
  • 119. Network messages How do we separate network messages from one another? 3 different ways: 1) Make all messages have the same length Thursday, May 24, 12
  • 120. Network messages How do we separate network messages from one another? 3 different ways: 1) Make all messages have the same length 2) Append a marker to each message Thursday, May 24, 12
  • 121. Network messages How do we separate network messages from one another? 3 different ways: 1) Make all messages have the same length 2) Append a marker to each message 3) Send some kind of header with some info about how long the message is Thursday, May 24, 12
  • 122. Network messages How do we separate network messages from one another? 3 different ways: 1) Make all messages have the same length 2) Append a marker to each message 3) Send some kind of header with some info about how long the message is Thursday, May 24, 12
  • 124. 3) Send some kind of header... Thursday, May 24, 12
  • 125. 3) Send some kind of header... Writing messages Thursday, May 24, 12
  • 126. 3) Send some kind of header... Writing messages • Convert an object into a byte array and measure its length Thursday, May 24, 12
  • 127. 3) Send some kind of header... Writing messages • Convert an object into a byte array and measure its length • Write the integer (4 bytes) that represents the length of our byte array to the stream Thursday, May 24, 12
  • 128. 3) Send some kind of header... Writing messages • Convert an object into a byte array and measure its length • Write the integer (4 bytes) that represents the length of our byte array to the stream • Write the actual byte array to the stream Thursday, May 24, 12
  • 130. Reading messages • Read first 4 bytes and interpret those as an integer called “x” Thursday, May 24, 12
  • 131. Reading messages • Read first 4 bytes and interpret those as an integer called “x” • Read “x” number of bytes. (stop when enough data has been received) Thursday, May 24, 12
  • 132. Reading messages • Read first 4 bytes and interpret those as an integer called “x” • Read “x” number of bytes. (stop when enough data has been received) • Turn received sequence of bytes back into an object. Thursday, May 24, 12
  • 137. Frameworks • Low level: BSD socket lib Thursday, May 24, 12
  • 138. Frameworks • Low level: BSD socket lib Thursday, May 24, 12
  • 139. Frameworks • Low level: BSD socket lib • High level: CFNetwork Thursday, May 24, 12
  • 140. Frameworks • Low level: BSD socket lib • High level: CFNetwork • Bonjour iOS API: NSNetServices, CFNetServices Thursday, May 24, 12
  • 143. Creating a server We first create a stream socket that will listen for connections Thursday, May 24, 12
  • 144. Creating a server We first create a stream socket that will listen for connections CFSocketRef listeningSocket; Thursday, May 24, 12
  • 145. Creating a server We first create a stream socket that will listen for connections CFSocketRef listeningSocket; using port number 0 Thursday, May 24, 12
  • 146. Creating a server We first create a stream socket that will listen for connections CFSocketRef listeningSocket; using port number 0 zero???? O_o Thursday, May 24, 12
  • 148. Let’s publish the service Thursday, May 24, 12
  • 149. Let’s publish the service Thursday, May 24, 12
  • 160. Please let me join Thursday, May 24, 12
  • 161. Please let me join Thursday, May 24, 12
  • 162. Please let me join Thursday, May 24, 12
  • 163. Please let me join Thursday, May 24, 12
  • 164. Please let me join Thursday, May 24, 12
  • 166. The server receives the “request” Thursday, May 24, 12
  • 167. The server receives the “request” Thursday, May 24, 12
  • 169. The server welcomes you Thursday, May 24, 12
  • 170. The server welcomes you Thursday, May 24, 12
  • 171. The server welcomes you Thursday, May 24, 12
  • 173. The client receives the stream Thursday, May 24, 12
  • 174. The client receives the stream Thursday, May 24, 12
  • 177. Recap • Apple Talk, TCP/IP Thursday, May 24, 12
  • 178. Recap • Apple Talk, TCP/IP • Bonjour flow cycle, uPNP Thursday, May 24, 12
  • 179. Recap • Apple Talk, TCP/IP • Bonjour flow cycle, uPNP • Application layers, Socket, Stream, Buffers Thursday, May 24, 12
  • 180. Recap • Apple Talk, TCP/IP • Bonjour flow cycle, uPNP • Application layers, Socket, Stream, Buffers • Write/Read Network messages Thursday, May 24, 12
  • 181. Recap • Apple Talk, TCP/IP • Bonjour flow cycle, uPNP • Application layers, Socket, Stream, Buffers • Write/Read Network messages • Create and publish a server Thursday, May 24, 12
  • 182. Recap • Apple Talk, TCP/IP • Bonjour flow cycle, uPNP • Application layers, Socket, Stream, Buffers • Write/Read Network messages • Create and publish a server • Join a server Thursday, May 24, 12
  • 183. Recap • Apple Talk, TCP/IP • Bonjour flow cycle, uPNP • Application layers, Socket, Stream, Buffers • Write/Read Network messages • Create and publish a server • Join a server • Interaction between the client and the server Thursday, May 24, 12
  • 184. Recap • Apple Talk, TCP/IP • Bonjour flow cycle, uPNP • Application layers, Socket, Stream, Buffers • Write/Read Network messages • Create and publish a server • Join a server • Interaction between the client and the server • One more thing: server broadcasts messages to connected clients Thursday, May 24, 12
  • 186. Thank you. Any questions? Nicholas Valbusa @squallstar Intesys - @Intesys_IT - www.intesys.it Thursday, May 24, 12