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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Javier Gonzalez-Sanchez
PRO
January 07, 2026
0
85
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
CSC364 Lecture 10
javiergs
PRO
0
82
CSC364 Lecture 09
javiergs
PRO
0
98
CSC307 Lecture 09
javiergs
PRO
1
840
CSC307 Lecture 08
javiergs
PRO
0
670
CSC364 Lecture 08
javiergs
PRO
0
32
CSC307 Lecture 07
javiergs
PRO
0
550
CSC364 Lecture 07
javiergs
PRO
0
93
CSC307 Lecture 06
javiergs
PRO
0
690
CSC364 Lecture 06
javiergs
PRO
0
83
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
750
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
720
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
Fireside Chat
paigeccino
41
3.8k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
From π to Pie charts
rasagy
0
120
How to train your dragon (web standard)
notwaldorf
97
6.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
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