...
This commit is contained in:
parent
36bfaddae3
commit
62c9333765
5 changed files with 27 additions and 2 deletions
6
.editorconfig
Normal file
6
.editorconfig
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
end_of_file = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
|
@ -1,4 +1,5 @@
|
||||||
+++
|
+++
|
||||||
title = "all pages"
|
title = "all pages"
|
||||||
template = "listing.html"
|
template = "listing.html"
|
||||||
|
page_template = "post.html"
|
||||||
+++
|
+++
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
+++
|
+++
|
||||||
title = "about me"
|
title = "about me"
|
||||||
template = "post.html"
|
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Hi there! I'm a Computer Science student at the University of Minnesota, and I've got a wide variety of interests under this field. I've been doing web development for a long time and now I'm looking into security, programming language development, and software development!
|
Hi there! I'm a Computer Science student at the University of Minnesota, and I've got a wide variety of interests under this field. I've been doing web development for a long time and now I'm looking into security, programming language development, and software development!
|
||||||
|
|
20
content/pages/analogies.md
Normal file
20
content/pages/analogies.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
+++
|
||||||
|
title = "interesting cs analogies"
|
||||||
|
+++
|
||||||
|
|
||||||
|
stupid analogies i think of in my free time
|
||||||
|
|
||||||
|
## socket server + multiple clients analogy
|
||||||
|
|
||||||
|
If you think about it, a server waiting for clients is kind of like the host at the front of a restaurant leading guests to tables. They don't actually take orders or serve food, they just stand at the front and wait for new guests to arrive. Then there's another waiter that's specifically assigned to take that table's orders.
|
||||||
|
|
||||||
|
When a server binds to, for example, `localhost:3000`, what the server really gets is a file descriptor; this is what's meant by:
|
||||||
|
|
||||||
|
```c
|
||||||
|
int socket(int domain, int type, int protocol);
|
||||||
|
int bind(int socket, const struct sockaddr *address, socklen_t address_len);
|
||||||
|
```
|
||||||
|
|
||||||
|
The `listen` library call then marks this socket as one that's open for connections, similar to marking the restaurant staff as a host rather than a waiter.
|
||||||
|
|
||||||
|
According to the manpage for `accept`, when a connection-mode socket accepts a connection, it'll "extract the first connection on the queue of pending connections, create a new socket with the same socket type protocol and address family as the specified socket, and allocate a new file descriptor for that socket." This new socket would be the waiter who actually takes your orders.
|
|
@ -1,6 +1,5 @@
|
||||||
+++
|
+++
|
||||||
title = "my setup"
|
title = "my setup"
|
||||||
template = "post.html"
|
|
||||||
+++
|
+++
|
||||||
|
|
||||||
## desktop
|
## desktop
|
||||||
|
|
Loading…
Reference in a new issue