Invited Speaker at the first "Deep into Smalltalk" spring school. 7-11 march 2011. The pdf of this slides is also available onlie at: http://car.mines-douai.fr/noury/docs/deepIntoSmalltalk2011
1 of 44
Downloaded 43 times
More Related Content
Pharo Networking by Example
1. Networking
by Example!
Noury Bouraqadi
http://car.mines-douai.fr/noury
"Deep Into Smalltalk" Spring School
8 march 2011 - Lille, France
2. 2
Agenda
• Networking Basics
– Sockets and protocols
– Client vs. Server
– Hands-on with SocketStream
• Serving
– Connection vs. communication
– Hands-on Concurrency!
• Complex interactions
– Exchanging objects over a network
– Remote messaging Hands-on
3. 3
Software Software
Nework
Process Process
Soc
ke oc ket
t S
Bi-directional communication
4. 4
Device A Device B
Software Software
Nework
Process Process
Soc
ke oc ket
t S
5. 5
Device Z
Software Software
Nework
Process Process
Soc
ke oc ket
t S
6. 6
2 Main
Transport
Protocols
TCP UDP
Transmission User
Control Datagram
Protocol Protocol
9. 9
Connection
Handling
Process
Server
Client A
Communication
Process
10. 10
Connection
Handling
Process
Server
Client A
Communication Communication
Process Process
11. 11
Connection
Handling
Process
Server Client B
Communication
Process
Client A
Communication Communication
Process Process
12. 12
Connection
Handling
Process
Server Client B
Communication Communication
Process Process
Client A
Communication Communication
Process Process
13. 13
Connection
Handling
Process Client C
Communication
Process
Server Client B
Communication Communication
Process Process
Client A
Communication Communication
Process Process
14. 14
Connection
Handling
Process Client C
Communication Communication
Process Process
Server Client B
Communication Communication
Process Process
Client A
Communication Communication
Process Process
15. 15
Client Socket
So cketS tream!
1. Connect to a server
2. Send a String
3. Receive a String
4. Close
16. 16
Server for Tests
Serve
Unix!
echo "Smalltalk" | nc –lk 12345
Multiple
Port
connections
number
21. 21
Tw itter
Luc: I’m struggling with the robots
----------
Noury: Which robots? WifiBots or
Robulabs?
----------
like
Luc: I need to setup the internal board of
Robulab #2
----------
22. 22
Multi-threaded
Server
1 process
for connections
1 process
for each client
Sycnrhonization
is needed
23. 23
Multi-threaded
fork
Server
1 process
for connections
1 process
for each client Mutex
Sycnrhonization
is needed
critical: