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
34
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 03
javiergs
PRO
1
450
CSC364 Lecture 03
javiergs
PRO
0
20
CSC307 Lecture 02
javiergs
PRO
1
740
CSC307 Lecture 01
javiergs
PRO
0
650
CSC364 Lecture 01
javiergs
PRO
0
130
CSC509 Lecture 15
javiergs
PRO
0
52
CSC305 Lecture 18
javiergs
PRO
0
290
CSC509 Lecture 14
javiergs
PRO
0
230
CSC305 Lecture 17
javiergs
PRO
0
350
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
300
Skip the Path - Find Your Career Trail
mkilby
0
29
The SEO Collaboration Effect
kristinabergwall1
0
320
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
75
Amusing Abliteration
ianozsvald
0
79
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
0
990
Abbi's Birthday
coloredviolet
0
4.1k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
730
What's in a price? How to price your products and services
michaelherold
246
13k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
120
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