This commit is contained in:
rottenwheel 2024-07-25 19:31:45 +00:00
parent 55864aba22
commit 94acaa0a2b
4 changed files with 4 additions and 4 deletions

View File

@ -1,2 +1,2 @@
<!doctype html><html class=dark lang=en-us><head><meta charset=UTF-8><title>404 Page not found</title>
<meta name=description content><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.128.2"><link rel=stylesheet href=/css/style.min.a2300dd0fbcbc91eb70c91148888ea7322a595ed0c5630ccc28d6beb44e8665d.css></head><body><div class=container><div class=header><ul><li class=home><a href=https://blog.rottenwheel.com/>rottenblog</a></li><li><a href=https://rottenwheel.com>about</a></li><li><a href=/>blog</a></li></ul></div><div class=content><h1>404</h1></div></div></body></html>
<meta name=description content><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.129.0"><link rel=stylesheet href=/css/style.min.a2300dd0fbcbc91eb70c91148888ea7322a595ed0c5630ccc28d6beb44e8665d.css></head><body><div class=container><div class=header><ul><li class=home><a href=https://blog.rottenwheel.com/>rottenblog</a></li><li><a href=https://rottenwheel.com>about</a></li><li><a href=/>blog</a></li></ul></div><div class=content><h1>404</h1></div></div></body></html>

View File

@ -1,2 +1,2 @@
<!doctype html><html class=dark lang=en-us><head><meta charset=UTF-8><title>rottenblog</title>
<meta name=description content><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.128.2"><link rel=stylesheet href=/css/style.min.a2300dd0fbcbc91eb70c91148888ea7322a595ed0c5630ccc28d6beb44e8665d.css></head><body><div class=container><div class=header><ul><li class=home><a href=https://blog.rottenwheel.com/>rottenblog</a></li><li><a href=https://rottenwheel.com>about</a></li><li><a href=/>blog</a></li></ul></div><div class=content><p>RSS feed <a href=/index.xml>here</a>.</p><h2>Latest Posts</h2><ul><li><a href=https://blog.rottenwheel.com/posts/post-1/>Example post</a> - 2022-01-28</li></ul></div></div></body></html>
<meta name=description content><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.129.0"><link rel=stylesheet href=/css/style.min.a2300dd0fbcbc91eb70c91148888ea7322a595ed0c5630ccc28d6beb44e8665d.css></head><body><div class=container><div class=header><ul><li class=home><a href=https://blog.rottenwheel.com/>rottenblog</a></li><li><a href=https://rottenwheel.com>about</a></li><li><a href=/>blog</a></li></ul></div><div class=content><p>RSS feed <a href=/index.xml>here</a>.</p><h2>Latest Posts</h2><ul><li><a href=/posts/post-1/>Example post</a> - 2022-01-28</li></ul></div></div></body></html>

View File

@ -1,3 +1,3 @@
<!doctype html><html class=dark lang=en-us><head><meta charset=UTF-8><title>Posts</title>
<meta name=description content><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.128.2"><link rel=stylesheet href=/css/style.min.a2300dd0fbcbc91eb70c91148888ea7322a595ed0c5630ccc28d6beb44e8665d.css></head><body><div class=container><div class=header><ul><li class=home><a href=https://blog.rottenwheel.com/>rottenblog</a></li><li><a href=https://rottenwheel.com>about</a></li><li><a href=/>blog</a></li></ul></div><div class=content><ul class=list><li><span>2022-01-28</span>
<meta name=description content><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.129.0"><link rel=stylesheet href=/css/style.min.a2300dd0fbcbc91eb70c91148888ea7322a595ed0c5630ccc28d6beb44e8665d.css></head><body><div class=container><div class=header><ul><li class=home><a href=https://blog.rottenwheel.com/>rottenblog</a></li><li><a href=https://rottenwheel.com>about</a></li><li><a href=/>blog</a></li></ul></div><div class=content><ul class=list><li><span>2022-01-28</span>
<a href=/posts/post-1/>Example post</a></li></ul></div></div></body></html>

View File

@ -1,5 +1,5 @@
<!doctype html><html class=dark lang=en-us><head><meta charset=UTF-8><title>Example post</title>
<meta name=description content><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.128.2"><link rel=stylesheet href=/css/style.min.a2300dd0fbcbc91eb70c91148888ea7322a595ed0c5630ccc28d6beb44e8665d.css></head><body><div class=container><div class=header><ul><li class=home><a href=https://blog.rottenwheel.com/>rottenblog</a></li><li><a href=https://rottenwheel.com>about</a></li><li><a href=/>blog</a></li></ul></div><div class=content><h1>Example post</h1><p>What you need to do is:</p><ol><li>Create the sockets.</li><li>Add the sockets to the set (<code>FD_SET</code>).</li><li>Find the socket with the highest file descriptor for calls to select().</li></ol><p>Above also works with different type sockets (e.g. <code>AF_INET</code>, <code>AF_INET6</code>). It even works if you have different type sockets (e.g. one IPv4 and one IPv6) listening on the same port number. Dual stack sockets are a thing but this approach is more flexible.</p><h2 id=create-sockets>Create sockets</h2><p>For this example I will be creating two sockets. One of them will have an IPv4 address and the other IPv6. Nothing out of the ordinary here.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-C data-lang=C><span style=display:flex><span> <span style=color:#75715e>/* Create IPv4 socket */</span>
<meta name=description content><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.129.0"><link rel=stylesheet href=/css/style.min.a2300dd0fbcbc91eb70c91148888ea7322a595ed0c5630ccc28d6beb44e8665d.css></head><body><div class=container><div class=header><ul><li class=home><a href=https://blog.rottenwheel.com/>rottenblog</a></li><li><a href=https://rottenwheel.com>about</a></li><li><a href=/>blog</a></li></ul></div><div class=content><h1>Example post</h1><p>What you need to do is:</p><ol><li>Create the sockets.</li><li>Add the sockets to the set (<code>FD_SET</code>).</li><li>Find the socket with the highest file descriptor for calls to select().</li></ol><p>Above also works with different type sockets (e.g. <code>AF_INET</code>, <code>AF_INET6</code>). It even works if you have different type sockets (e.g. one IPv4 and one IPv6) listening on the same port number. Dual stack sockets are a thing but this approach is more flexible.</p><h2 id=create-sockets>Create sockets</h2><p>For this example I will be creating two sockets. One of them will have an IPv4 address and the other IPv6. Nothing out of the ordinary here.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-C data-lang=C><span style=display:flex><span> <span style=color:#75715e>/* Create IPv4 socket */</span>
</span></span><span style=display:flex><span> <span style=color:#66d9ef>struct</span> sockaddr_in serv_addr4, cli_addr4;
</span></span><span style=display:flex><span> <span style=color:#66d9ef>int</span> addrlen4 <span style=color:#f92672>=</span> <span style=color:#66d9ef>sizeof</span>(cli_addr4);
</span></span><span style=display:flex><span>