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
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
180
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Heart Work Chapter 1 - Part 1
lfama
PRO
3
35k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
0
380
A better future with KSS
kneath
240
18k
Navigating Weather and Climate Data
rabernat
0
61
How STYLIGHT went responsive
nonsquared
100
6k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.2k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
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