Socket Programming

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Internet Edinanness

- The Internet standardised on big-endian

What is a protocol and what are 2 things it might describe?

- A protocol describes exactly how the communication should happen. E.g. - What order are the bits sent in? - What do the individual bits mean? - Necessary so the computer at the other end can understand the communication - Must be precise

TCP connections

- Gives us a reliable, stream-oriented connection to another machine - Once machine needs to be listening for a connection on a specific port - Second machine needs to connect to that open port - Once open, the connection is bidirectional

htonl() / htons()

- Host to network long/short - Converts a 32-bit (long) or 16-bit (short) number from host byte-ordering to network byte-ordering

ntohl() / ntohs()

- Network to host long/short - Converts a 32-bit (long) or 16-bit (short) number from network byte-ordering to host byte-ordering

Endianness

- Refers to how the bytes which are part of collections of bytes (for big numbers like addresses) are laid out in memory

Client-Server Paradigm

- Server is software actively listening for a connection - Client is software that connects to the server - Need both to form an active connection

Berkeley Sockets

- Treats network I/O as if they were files (Influenced by UNIX) - API for TCP/IP - Aims to be network-agnostic

Berkeley sockets functions used on both client & server (in order you might use them)

- socket() => Create a socket, rather than open()ing a connection, this forms one end of the connection - read() - write() - close()

Little Endian

Mirror of Big Endian, least significant byte first (Looks backwards in memory but can make chip design easier)

Big Endian

Most significant bytes first


Ensembles d'études connexes

Mental Health Exam 4 Practice Q's

View Set

HSC4713: Planning and Evaluation, HSC 4713 Module 10: Program Resources and Management, HSC 4713 Module 12: Implementation, HSC 4713 - Module 14 Evaluation Approaches and Design, Module 13 - Purposes and Logistics of Evaluation; Evaluation Approaches...

View Set

MANAGEMENT and ORGANIZATIONAL BEHAVIOR

View Set