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
100
CSC307 Lecture 09
javiergs
PRO
1
840
CSC307 Lecture 08
javiergs
PRO
0
670
CSC364 Lecture 08
javiergs
PRO
0
33
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
The World Runs on Bad Software
bkeepers
PRO
72
12k
Statistics for Hackers
jakevdp
799
230k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
WCS-LA-2024
lcolladotor
0
450
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
53
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
76
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
From π to Pie charts
rasagy
0
120
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3k
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