Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CSC364 Lecture 02
Search
Javier Gonzalez-Sanchez
PRO
January 07, 2026
0
80
CSC364 Lecture 02
Introduction to Networked, Distributed, and Parallel Computing
Sockets
(202601)
Javier Gonzalez-Sanchez
PRO
January 07, 2026
Tweet
Share
More Decks by Javier Gonzalez-Sanchez
See All by Javier Gonzalez-Sanchez
CSC307 Lecture 07
javiergs
PRO
0
530
CSC364 Lecture 07
javiergs
PRO
0
71
CSC307 Lecture 06
javiergs
PRO
0
670
CSC364 Lecture 06
javiergs
PRO
0
73
CSC307 Lecture 05
javiergs
PRO
0
490
CSC364 Lecture 05
javiergs
PRO
0
72
CSC364 Lecture 04
javiergs
PRO
0
87
CSC307 Lecture 04
javiergs
PRO
0
650
CSC307 Lecture 03
javiergs
PRO
1
480
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
810
Rails Girls Zürich Keynote
gr2m
96
14k
Statistics for Hackers
jakevdp
799
230k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
630
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
130
エンジニアに許された特別な時間の終わり
watany
106
230k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
51
The SEO Collaboration Effect
kristinabergwall1
0
340
Git: the NoSQL Database
bkeepers
PRO
432
66k
Transcript
Dr. Javier Gonzalez-Sanchez
[email protected]
www.javiergs.info o ffi ce: 14 -227
CSC 364 Introduction to Networked, Distributed, and Parallel Computing Lecture 02. Sockets 1
2 Goal This is called a system, not just a
program.
3 Concepts Device A (IP address) 🏭 🏭 🏭 🏭
Port Port Port Port Port Port Port Port Socket Socket Device B (IP address)
4 Goal If we can make two programs talk to
each other, everything else in the course has a place to land.
5 De f inition A socket is a bidirection a
l byte stre a m between two processes (progr a ms) Import a nt: • Not mess a ges (text) • Not objects • Just bytes
6 Why they matters? Sockets a re used everywhere: •
HTTP servers • Multipl a yer g a mes • Distributed d a t a b a ses • ROS nodes S a me ide a s. Bigger sc a le.
7 Client - Server Architecture Server 1. Cre a te
socket 2. Bind to port 3. Listen 4. Accept connection Client 1. Cre a te socket 2. Connect to server 3. Send / receive d a t a
Note
9 Localhost or 127.0.0.1 loc a lhost A hostn a
me th a t me a ns this computer 127.0.0.1 The IP a ddress of the loopb a ck interf a ce ➡ Both refer to the s a me m a chine you a re running on
10 How to Get Your IP Address m a cOS
/ Linux ifcon f ig Look for inet under en0 (Wi-Fi) or en1. Windows (Comm a nd Prompt or PowerShell) ipcon f ig Look for IPv4 Address.
Client-Server Sockets
Client-Server 12
Implementation :: Server 13 chrestomathy: https://www.javatpoint.com/socket-programming
Implementation :: Client 14 chrestomathy: https://www.javatpoint.com/socket-programming
15 Homework Run the example Break it!
16 Failure Is Normal Try this: • Kill the server
• Disconnect the client • Send inv a lid d a t a Common errors: • Connection refused • Timeout
17 Questions
Lab 02. Object-Oriented Programming Refresher II
Previously
20 Paint App
21 Blueprint (First Draft)
None
None
None
None
Next
27 Paint App
class TheNanny implements ActionListener { public void actionPerformed (ActionEvent e)
{ } }
29 Paint App
class MyVeryOwnCenterPanel extends JPanel { public void paintComponent (Graphics g)
{ } }
class TheMouseNanny implements MouseListener { public void mousePressed (MouseEvent e)
{ } public void mouseClicked(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mouseDragged(MouseEvent me) { } public void mouseMoved(MouseEvent e) { } }
// MouseListener public void mousePressed (MouseEvent e) {} public void
mouseClicked(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mouseDragged(MouseEvent me) { } public void mouseMoved(MouseEvent e) { } // MouseMotionListener public void mouseDragged(MouseEvent me) { } public void mouseMoved(MouseEvent e) { }
33 Paint App
34 Test Yourselves https://github.com/CSC3100/App-Paint/
CSC 364 Introduction to Introduction to Networked, Distributed, and Parallel
Computing Javier Gonzalez-Sanchez, Ph.D.
[email protected]
Winter 2026 Copyright. These slides can only be used as study material for the class CSC 364 at Cal Poly. They cannot be distributed or used for another purpose. 35