Python and Socket Programming Vocab

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Self keyword

'self' is like 'this' in java, but it is not implicit like it is in java and is not a keyword either(it has to be specified and you can actually use a completely different word), but it's still preferred to use 'self' when referring to the current object because that's what has grown to be custom

active open

A client process using TCP takes the "active role" and initiates the connection by actually sending a TCP message to start the connection (a SYN message).

passive open

A server process designed to use TCP, however, takes a more "laid-back" approach. It performs a passive OPEN by contacting TCP and saying "I am here, and I am waiting for clients that may wish to talk to me to send me a message on the following port number". The OPEN is called passive because aside from indicating that the process is listening, the server process does nothing.

Stream socket

A stream socket is a type of internet socket which provides a connection-oriented, sequenced, and unique flow of data without record boundaries, with well-defined mechanisms for creating and destroying connections and for detecting errors. (TCP)

For/else

In a construct like this one: for i in foo: if bar(i): break else: baz() the else suite is executed after the for, but only if the for terminates normally (not by a break).

dictionary

It is best to think of a dictionary as an unordered set of key: value pairs, with the requirement that the keys are unique (within one dictionary). A pair of braces creates an empty dictionary: {}. Placing a comma-separated list of key:value pairs within the braces adds initial key:value pairs to the dictionary; this is also the way dictionaries are written on output. (kinda like hashmap)

None keyword

None is used to represent the absence of a value, as when default arguments are not passed to a function.

range()

a versatile function to create lists containing arithmetic progressions. It is most often used in for loops.

multiple assignment

assigning multiple variables to one value at the same time (this is a rough definition)

immutable

When a value of an object cannot be changed

datagram socket

A datagram socket is a type of connectionless network socket, which is the point for sending or receiving of packet delivery services. Each packet sent or received on a datagram socket is individually addressed and routed (UDP and packets can get lost and received out of order, unlike TCP)

docstring

A docstring is a string literal that occurs as the first statement in a module, function, class, or method definition. Such a docstring becomes the __doc__ special attribute of that object.

lambda functions

Anonymous functions (functions not bound to a name) that can be created and used instantly and then forgotten when it's not needed anymore. (Very powerful..?)

String concatenation

Concatenation combines two (or more) strings into a new string object. In Python, you can use + operator and use + str(int) to concatenate int's and strings.

Timeout exception

Raised when a system function timed out at the system level.


Set pelajaran terkait

Chapter 10: Paired Samples t Test

View Set

Care of the Client with Impaired Renal Function

View Set

CHM/lab operation practice questions

View Set

The Scientific Revolution & Enlightenment

View Set