InputStreamReader
what does the server socket do?
listens for connections on the specified port
new ServerSocket(port);
how does a ServerSocket accept a connection from a client Socket?
Socket clientSocket = serverSocket.accept()
PrintWriter
wraps an output stream
new PrintWriter(outputStream)
automatic line flushing
can’t write raw bytes
What 5 things do you need to implement a ChatServer?
Runnable
A class that implements Runnable can run without subclassing Thread by instantiating a Thread instance and passing itself in as the target.
what does scanner take as a param?
System.in
checklist
start threads
close sockets
update loop variables
difference between streams and readers
stream work with binary data and readers work with characters
DataInputStream
read primitive java data types in machine-independent way