Memra

academic · advanced · ≈ 12 h · Athabasca University

COMP 348 — Practical Java Network Programming

Sockets, protocols, and servers — typed line by line

A full Java networking course: the TCP/IP layer model and which java.net class lives at which layer, stream and reader I/O, the concurrency a server actually needs (threads, executors, and why the accept loop must not block), URIs and URLConnection, HTTP as a protocol you read and write by hand, client and server sockets, a working multithreaded HTTP server, protocol design as a finite state machine, RMI, JavaMail, non-blocking I/O with buffers, channels and selectors, and TLS, UDP and multicast. Every Java idiom is typed, not skimmed, and every module carries the exam framing and the pitfall that costs marks.

0 / 68 lessons
Reviews stop being scheduled for after it.

up next

Why networks are built in layers

9 m

Start course

The network underneath Java

0 / 7 lessons
  1. Why networks are built in layers 9 m
  2. The four layers, one at a time 10 m
  3. IP, TCP, and UDP 11 m
  4. Addresses, ports, and names 10 m
  5. The internet you actually deploy into 10 m
  6. InetAddress: resolving names and addresses 9 m
  7. Inspecting an address, and every address this host has 10 m

Streams: the I/O every socket speaks

0 / 5 lessons
  1. OutputStream, and why flush() is not optional 10 m
  2. InputStream and the shape of a read 10 m
  3. Filter streams: chaining, buffering, and data streams 11 m
  4. Where bytes become text: readers, writers, encodings 12 m
  5. Your first network program 11 m

Concurrency for network programs

0 / 6 lessons
  1. Why network code is concurrent, and how to start a thread 10 m
  2. Getting a result back out 11 m
  3. Synchronization, and choosing what to lock 12 m
  4. Not locking: confinement, immutability, safe collections, deadlock 11 m
  5. Thread pools: `ExecutorService`, `Callable`, `Future` 12 m
  6. Worked build: a pooled weblog analyser 14 m

URLs, URIs, and URLConnection

0 / 6 lessons
  1. URI, URL, and relative references 10 m
  2. The URL class: construct, split, read 11 m
  3. Equality, the URI class, and form encoding 11 m
  4. URLConnection: the lifecycle and reading data 10 m
  5. Headers, charsets, and HttpURLConnection 12 m
  6. Worked build: a source viewer that greps 13 m

HTTP

0 / 5 lessons
  1. The HTTP exchange, by hand 10 m
  2. The request: line, methods, headers, body 11 m
  3. The response: status line, codes, and content types 11 m
  4. Caching: freshness, revalidation, and ResponseCache 10 m
  5. Keep-alive, chunking, and cookies 12 m

Sockets for clients

0 / 5 lessons
  1. What a `Socket` is 10 m
  2. Reading from a server: a line-protocol client 12 m
  3. Writing to a server: request/response turns 12 m
  4. Constructing, connecting, and interrogating a socket 10 m
  5. Socket options and the exception family 12 m

Sockets for servers

0 / 5 lessons
  1. `ServerSocket` and the accept loop 11 m
  2. One at a time is a queue: going multithreaded 11 m
  3. Thread-pooled servers 11 m
  4. Binding, options, and clean shutdown 10 m
  5. Logging a server 12 m

Build a working HTTP server

0 / 5 lessons
  1. The smallest server that speaks HTTP 10 m
  2. Parsing the request line and mapping a path — safely 12 m
  3. Serving many files: media types and binary output 12 m
  4. The errors a server owes its clients 10 m
  5. Worked build: access logging, end to end 12 m

Protocol design as an FSM

0 / 4 lessons
  1. What a protocol specification must pin down 11 m
  2. A session as a finite-state machine 11 m
  3. Writing the specification document 12 m
  4. Worked build: the Poem-of-the-Day server 14 m

Java RMI

0 / 5 lessons
  1. Distributed objects, and what a stub is 10 m
  2. The remote interface and its implementation 10 m
  3. Exporting and the registry 11 m
  4. Parameters, returns, and what actually crosses the wire 11 m
  5. Worked build: the prime service, and its failure modes 13 m

JavaMail

0 / 4 lessons
  1. The three mail protocols, at the telnet level 11 m
  2. Sending: Session, MimeMessage, Transport 12 m
  3. Attachments: MimeMultipart and MimeBodyPart 11 m
  4. Receiving: Store, Folder, Message, and flags 12 m

Non-blocking I/O

0 / 5 lessons
  1. Why non-blocking I/O — and the case against it 10 m
  2. Buffers: four numbers and one invariant 12 m
  3. ByteBuffer in practice 11 m
  4. Channels: SocketChannel and ServerSocketChannel 12 m
  5. Selectors: one thread, many connections 13 m

TLS, UDP, multicast

0 / 6 lessons
  1. What TLS actually gives you 10 m
  2. SSLSocket clients and HTTPS 11 m
  3. SSLServerSocket and keystores 11 m
  4. UDP: when losing packets is the right trade 10 m
  5. DatagramPacket and DatagramSocket 12 m
  6. Multicast: one send, many receivers 12 m
~/memra/learn/comp-348