Networking by Example
Noury Bouraqadi http://car.mines-douai.fr/noury
"Deep Into Smalltalk" Spring School 8 march 2011 - Lille, France
Networking by Example Noury Bouraqadi - - PowerPoint PPT Presentation
Networking by Example Noury Bouraqadi http://car.mines-douai.fr/noury "Deep Into Smalltalk" Spring School 8 march 2011 - Lille, France 2 Agenda Networking Basics Sockets and protocols Client vs. Server Hands-on
Noury Bouraqadi http://car.mines-douai.fr/noury
"Deep Into Smalltalk" Spring School 8 march 2011 - Lille, France
– Sockets and protocols – Client vs. Server – Hands-on with SocketStream
– Connection vs. communication – Hands-on Concurrency
– Exchanging objects over a network – Remote messaging Hands-on
2
3
Socket Nework Software Process Software Process Socket
4
Socket Nework Software Process Software Process Socket
5
Socket Nework Software Process Software Process Socket
6
Transmission Control Protocol User Datagram Protocol
7
8
9
Connection Handling Process
Communication Process
10
Connection Handling Process
Communication Process Communication Process
11
Connection Handling Process
Communication Process Communication Process
Communication Process
12
Connection Handling Process Communication Process
Communication Process Communication Process
Communication Process
13
Connection Handling Process Communication Process
Communication Process Communication Process
Communication Process
Communication Process
14
Connection Handling Process Communication Process Communication Process
Communication Process Communication Process
Communication Process
Communication Process
15
16
17
18
19
20
connectionSock := Socket newTCP. [ connectionSock listenOn: 12345 backlogSize: 10. interactSock := connectionSock waitForAcceptFor: 30. stream := SocketStream on: interactSock. stream sendCommand: 'Pharo Server!’. Transcript cr; show: stream nextLineLf. ] ensure: [ connectionSock closeAndDestroy. stream close.]
21
Luc: I’m struggling with the robots
Robulabs?
Robulab #2
22
23
24
So Socket 1 So Socket 2
25
So Socket 1 So Socket 2
10@ 10@34 34 10@ 10@34 34
26
27
28
29
pr proxy
So Socket 1 So Socket 2
dispa dispatche her
30
pr proxy id id1
So Socket 1 So Socket 2
dispa dispatche her id id1
id id3
31
32
33
34
35
What Next?
Socket HTTPSocket SocksSocket SocketAdress ByteArray TCP+ UDP+… IPv4 +IPv6 IPv4 +IPv6
TcpSocket UdpSocket NetworkLibraryProxyFactory WindowsLibrary LinuxLibrary Socket
networkLibrary socketID
MacOSLibrary NetworkingPlugin WrapperLibrary
TcpSocket UdpSocket NetworkLibraryProxyFactory WindowsLibrary LinuxLibrary Socket
networkLibrary socketID
MacOSLibrary NetworkingPlugin WrapperLibrary
VM Image OS
Plugin Wrapper Network API
Socket Plugin Socket Library
ALL Primitives !
VM Image OS
Posix Library Wrapper Posix Library
FFI Plugin Socket Library
50 100 150 200 250 300 350 Receive 10MB Send 10MB ms Ocean OldSocket
VM Image Other OS
Library A Library B Library Z API α API β API ψ
FFI
44