<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mehdi BR</title>
    <description>The latest articles on DEV Community by Mehdi BR (@nullora).</description>
    <link>https://dev.to/nullora</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3813620%2Fc12c912f-f259-49de-b0c4-2b9d856daeaa.png</url>
      <title>DEV Community: Mehdi BR</title>
      <link>https://dev.to/nullora</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nullora"/>
    <language>en</language>
    <item>
      <title>I made my own Bootloader at 16. It was horrible. It was worth it.</title>
      <dc:creator>Mehdi BR</dc:creator>
      <pubDate>Wed, 18 Mar 2026 06:58:22 +0000</pubDate>
      <link>https://dev.to/nullora/i-made-my-own-bootloader-at-16-it-was-horrible-it-was-worth-it-2nc1</link>
      <guid>https://dev.to/nullora/i-made-my-own-bootloader-at-16-it-was-horrible-it-was-worth-it-2nc1</guid>
      <description>&lt;h1&gt;
  
  
  Why I even did it
&lt;/h1&gt;

&lt;p&gt;I have this obsession of wanting to understand every little thing on my computer. Every wire, every line of code, every register, I always wanted to know it all. &lt;/p&gt;

&lt;h1&gt;
  
  
  How I started
&lt;/h1&gt;

&lt;p&gt;About 2 days before, I learned about Bootloaders and how they are the first program to run on a computer. The description alone sparked a feeling I never knew existed. I started imagining my own bootloader, my own program to be run first thing by my machine. That thought alone put me to work.&lt;/p&gt;

&lt;h1&gt;
  
  
  The story
&lt;/h1&gt;

&lt;p&gt;That night, I started digging through UEFI documentation. I found a few videos detailing how Bootloaders speak to the firmware, I even followed a step by step tutorial video. Nothing worked, everything crashed the QeMu simulation. I couldn't even print a simple Hello World. I decided to keep pushing a few more hours before fully giving up, until i found &lt;a href="https://mjg59.dreamwidth.org/18773.html" rel="noopener noreferrer"&gt;this&lt;/a&gt; paper. It pointed out such a specific problem that I felt only &lt;strong&gt;I&lt;/strong&gt; had. Nothing on the internet described my problem and solved it, except this paper. I couldn't tell what exactly clicked, it wasn't a grand explanation, just a small snippet of code that made me look at mine in confusion. I was doing it all wrong. I finally printed my very own hello world! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9w9whd7szxi3tndpvnu8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9w9whd7szxi3tndpvnu8.png" alt=" " width="800" height="538"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This sight alone made me the happiest person in the world at 4 in the morning. I went back to the step by step tutorial and debugged every little thing that didn't work from the video. AI couldn't help, it was just me and poorly made, horrible looking documentation: the pinnacle of computer development. Slowly, I understood how everything worked. Sure there were some parts that took 12 hours to debug, but that was all part of the ride. At the end of all that, I got to see my 3 line kernel be loaded by my own custom bootloader. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm17d1tsfu1ud03fdgipq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm17d1tsfu1ud03fdgipq.png" alt=" " width="800" height="538"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That little &lt;strong&gt;123&lt;/strong&gt; you see at the end, that's printed from my kernel. Seeing that 123 print was the best moment of my life. I decided to run it on my real machine, not a QeMu emulator, I had to see my own Bootloader run on my machine, and for the first time ever, it worked first try. It was beautiful, seeing everything go as it should've could've made a grown man cry.&lt;/p&gt;

&lt;h1&gt;
  
  
  Tools I used
&lt;/h1&gt;

&lt;p&gt;Making this project, I used multiple tools I made beforehand to help.&lt;br&gt;
GitHub repos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/Nullora/NUB" rel="noopener noreferrer"&gt;NUB&lt;/a&gt; (Novus UEFI Builder) &lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Nullora/NovusDeploy" rel="noopener noreferrer"&gt;NovusDeploy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Nullora/NCC" rel="noopener noreferrer"&gt;NCC&lt;/a&gt; (Novus C Compiler)&lt;/li&gt;
&lt;li&gt;All made by me in C/C++. Star them if you wanna support! &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Where to find the kernel/bootloader
&lt;/h1&gt;

&lt;p&gt;You can find them at &lt;a href="https://github.com/Nullora/NovusKernel" rel="noopener noreferrer"&gt;this&lt;/a&gt; GitHub repo, star it if you wanna support me and follow my journey!&lt;/p&gt;

</description>
      <category>c</category>
      <category>cpp</category>
      <category>career</category>
      <category>programming</category>
    </item>
    <item>
      <title>How designing a CPU made me code better</title>
      <dc:creator>Mehdi BR</dc:creator>
      <pubDate>Mon, 16 Mar 2026 03:53:21 +0000</pubDate>
      <link>https://dev.to/nullora/how-designing-a-cpu-made-me-code-better-3lle</link>
      <guid>https://dev.to/nullora/how-designing-a-cpu-made-me-code-better-3lle</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frc97jylxzx1eqqop7rp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frc97jylxzx1eqqop7rp6.png" alt=" " width="800" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why I even started
&lt;/h1&gt;

&lt;p&gt;I always looked at my computer in awe. "How does a clunk of metal do such beautiful things?" I ask myself. I always thought of them as a black box of magic, you just input data and it comes out however you want it. Until one day, I decided to truly learn how it works.&lt;/p&gt;

&lt;h1&gt;
  
  
  The story
&lt;/h1&gt;

&lt;p&gt;I started about a year ago, with the aim of understanding how computers work at the lowest level. I started by following a simple YouTube tutorial. I just copy pasted what the creator did and it worked. At some point though, it stopped working. I panicked, I had no AI to help me because it's too dumb to work with extremely low level stuff, and I could not debug it because I copied all of it with no real knowledge. That was when I decided to give up, I did not wanna deal with debugging stuff that I did not understand. &lt;br&gt;
Until about 2 months ago, I decided to stray back into that field. I dove into how a CPU handles data and instructions, and slowly, I understood how it all worked. No AI, no YouTube tutorial that I did not understand. I fully owned the CPU and the knowledge behind it.&lt;/p&gt;

&lt;h1&gt;
  
  
  How it helped
&lt;/h1&gt;

&lt;p&gt;Making this CPU helped me understand how a computer works deep down. I stopped thinking of them as a black magic boxes and started visualizing their own unique components. The ALU, RAM, program counter... All these seem surface level stuff, but truly working with them and forcing them to interact is what makes it all click.&lt;br&gt;
Understanding how a computer works is, in my opinion, essential for coding anything lower-level than python. You understand how data flows, how components interact, and how each part of your CPU speaks.&lt;br&gt;
You stop looking at std functions as a spell, and start looking at them as simplified CPU instruction.&lt;/p&gt;

&lt;h1&gt;
  
  
  Where to find it, and where to start
&lt;/h1&gt;

&lt;p&gt;You can find this project &lt;a href="https://github.com/Nullora/Novus-Core1" rel="noopener noreferrer"&gt;here&lt;/a&gt;, please star it if you wanna support me, and check other repos if you are interested in my work. &lt;br&gt;
To start making your own CPU, start like me, by looking at YouTube tutorials. Don't follow it blindly, instead google each component before even building it, then try to make the component on your own after understanding what it does. When you're done building it on your own, go back to the tutorial and watch what the creator did different and how theirs is potentially better than yours.&lt;br&gt;
Keep in mind, no one did this is a week or a day. Don't get mad if you don't instantly get it. It took me a whole year!&lt;/p&gt;

&lt;h1&gt;
  
  
  Note
&lt;/h1&gt;

&lt;p&gt;I designed the CPU in Logisim, the documentation for it can be found at Novus-Core1/Documents/inst.md&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>programming</category>
      <category>cpp</category>
      <category>networking</category>
    </item>
    <item>
      <title>Simple C++ networking libraries don't exist anymore - here's the fix.</title>
      <dc:creator>Mehdi BR</dc:creator>
      <pubDate>Fri, 13 Mar 2026 17:37:50 +0000</pubDate>
      <link>https://dev.to/nullora/simple-c-networking-libraries-dont-exist-anymore-heres-the-fix-f3d</link>
      <guid>https://dev.to/nullora/simple-c-networking-libraries-dont-exist-anymore-heres-the-fix-f3d</guid>
      <description>&lt;h1&gt;
  
  
  Recap
&lt;/h1&gt;

&lt;p&gt;About 4 days ago, I posted a blog about my networking library, NovusNet, found &lt;a href="https://dev.to/nullora/i-made-my-own-c-networking-library-at-16-heres-how-1ape"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The problem
&lt;/h1&gt;

&lt;p&gt;C++ networking libraries fall into 2 categories: Either too complex for simple use, or easy but unreliable. NovusNet fills a gap: Simple, secure, and fast.&lt;/p&gt;

&lt;h1&gt;
  
  
  What I added since then
&lt;/h1&gt;

&lt;p&gt;Now, NovusNet offers a perfectly secure connection between 2 devices. Fully encrypted and limited access with passwords. Another big thing is the inclusion of NFTP, my own file transfer protocol, now integrated into the library. NFTP transfers any size file across the network safely and quickly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Usage
&lt;/h1&gt;

&lt;p&gt;Server-side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;"nn.hpp"&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;chrono&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="c1"&gt;//runServer() now takes an additional variable: string password.&lt;/span&gt;
    &lt;span class="n"&gt;runServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9090&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"YOUR_PASSWORD"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// onMessage listens for any incoming message&lt;/span&gt;
    &lt;span class="n"&gt;onMessage&lt;/span&gt;&lt;span class="p"&gt;([](&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;clientN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="c1"&gt;// if the client announces a file is coming, receive it&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"SENDING_FILE"&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="c1"&gt;//recvFile() takes the download folder, and the client id.&lt;/span&gt;
            &lt;span class="n"&gt;recvFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Downloads"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;clientN&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// saves to Downloads folder&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="c1"&gt;// keeps main() alive without tanking CPU&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;chrono&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;milliseconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Client-side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Client-side file sender&lt;/span&gt;
&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;"nn.hpp"&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="c1"&gt;// connect to server with ip, port, and password&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;runClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9090&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"PassTest"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// receive and store the clientID assigned by the server&lt;/span&gt;
    &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;recvMsg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;clientID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;stoi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// announce to the server that a file is incoming&lt;/span&gt;
    &lt;span class="n"&gt;sendMsg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"SENDING_FILE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;clientID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// send the file&lt;/span&gt;
    &lt;span class="c1"&gt;// sendFile() takes filepath and clientID assigned by the server.&lt;/span&gt;
    &lt;span class="n"&gt;sendFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"image.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;clientID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Where it's going
&lt;/h1&gt;

&lt;p&gt;As time goes, I'll update this library until it's perfect. I will move onto another project once this is done. Check it out on &lt;a href="https://github.com/Nullora/NovusNet" rel="noopener noreferrer"&gt;NovusNet&lt;/a&gt; and star it if you wanna support! If you want a clearer explanation, check &lt;a href="https://github.com/Nullora/NovusChat" rel="noopener noreferrer"&gt;NovusChat&lt;/a&gt;, it's a side project made purely on NovusNet to showcase the library's ability and simplicity.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>networking</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>I made my own C++ networking library at 16: here's how.</title>
      <dc:creator>Mehdi BR</dc:creator>
      <pubDate>Mon, 09 Mar 2026 18:14:58 +0000</pubDate>
      <link>https://dev.to/nullora/i-made-my-own-c-networking-library-at-16-heres-how-1ape</link>
      <guid>https://dev.to/nullora/i-made-my-own-c-networking-library-at-16-heres-how-1ape</guid>
      <description>&lt;h1&gt;
  
  
  The Problem
&lt;/h1&gt;

&lt;p&gt;Around a week ago, I wanted to focus on networking to start working on a home lab project. During this, I thought to myself: "Are there any simple libraries out there?" So I took to searching, I only found big libraries like Boost.Asio that are way too overkill for my needs, and honestly, too hard for me, or any beginner/intermediate developer, to understand. So I decided to make my own simple library, NovusNet, focused towards people of the same niche as me, people that don't need the complexity of larger libraries.&lt;/p&gt;

&lt;h1&gt;
  
  
  The idea
&lt;/h1&gt;

&lt;p&gt;Before I even started coding, I sat down and thought to myself: "What do I want this library to be?" Simple, I needed it to be easy to understand, not have complex stuff that you don't need, and overall be as beginner friendly as possible without making it slow and unsafe.&lt;/p&gt;

&lt;h1&gt;
  
  
  The build
&lt;/h1&gt;

&lt;p&gt;With the keyboard at my fingertips, I began coding, it was super simple at first, just setting up sockets and shoving them into functions. But as hours went by, I started to want more features. I dove into threads to start multi-client handling, which alone took me about 2 days of straight coding. I dove into OpenSSL to encrypt every connection, which took me around a day of googling new stuff. All that led the project to where it is now.&lt;br&gt;
Setting up networking has never been so easy:&lt;/p&gt;

&lt;h2&gt;
  
  
  Server-side
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;"nn.hpp"&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;chrono&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="n"&gt;runServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9090&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;//"onMessage" returns clientN and msg of any received message from any client.&lt;/span&gt;
    &lt;span class="n"&gt;onMessage&lt;/span&gt;&lt;span class="p"&gt;([](&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;clientN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="c1"&gt;//more detailed logic can go on here depending on what you wanna do.&lt;/span&gt;
        &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"Client "&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;clientN&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;": "&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;chrono&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;milliseconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Client-side
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;"nn.hpp"&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;//runClient(ip,port) connects to a server&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;runClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9090&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;//receive client id and assign it for later use&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;recvMsg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;clientFD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;stoi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;clientFD&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sc"&gt;'\n'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;getline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="c1"&gt;//sendMsg(string msg) sends data as a string&lt;/span&gt;
        &lt;span class="n"&gt;sendMsg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Results
&lt;/h1&gt;

&lt;p&gt;NovusNet is now far easier to setup than any other pure c++ networking library. The average person making a home lab or a simple multiplayer game never needed a library as big as the ones currently available, they just needed something easy, fast, and secure.&lt;/p&gt;

&lt;h1&gt;
  
  
  What I learned
&lt;/h1&gt;

&lt;p&gt;Working on this project taught me a lot about callbacks, lambdas, threads, and sockets. It also taught to make my own solution when I can't find someone else's.&lt;/p&gt;

&lt;h1&gt;
  
  
  Overall
&lt;/h1&gt;

&lt;p&gt;I'm 16 and this is my first major project along with some other smaller ones on GitHub. If you're a beginner who believes networking is out of reach, it's not. You can find my project at &lt;a href="https://github.com/Nullora/NovusNet" rel="noopener noreferrer"&gt;NovusNet&lt;/a&gt;. If you wanna support me, go check it out and star it!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>cpp</category>
      <category>networking</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
