Last week we introduced some Python bits defining functions multithreading the socket object packing things into specific byte sequences A couple terminology notes: Since we just learned functions! function: code somewhere else you can run by calling it def my_function(parameter_if_we_have_one): ... code that's part of the function ... function call: Where you call a function myfunction(5) Or if we don't have any parameters: myfunction() method: A function that's attached to an object It's still a function It "knows" what object it's attached to "self" parameter, frozen fractals example In python, accept, recv, send, etc. are methods Use . to refer to them variable: A bit of memory that holds a value The value can change (as in, vary) property: A variable that's attached to an object If we print out a socket, we see the properties Could refer to them with . It's not a function; don't try to call it Object-oriented program: A program arranged with objects Requires a decently-sized program to make any sense Game engine example (sorry, it's not in Python) Object-oriented language: A language that caters to object-oriented programs You don't need one to do object-oriented programming Example: Linux kernel A proper OO language supports inheritance thread of execution (just called "thread" usually): A series of instructions the scheduler can handle Python limitation: The interpreter isn't multithreaded So it'll run all threads on one CPU Demo Lots of networking involves mostly waiting anyway thread vs. process from multiprocessing import process, try that too In C, things are different pthreads will let us make a processes with over 100% load concurrency: Doing more than one thing at once This brings up a bunch of problems Example: Dining philosophers Solving concurrency pickles isn't really part of this class Let's do something with all that! port opener program Today's lab: Proxy server that you can't really control If you want, run it on isoptera Alternatively, local will work, or wherever It'll be both a client and a server!