Skip to content

Raffiepro/mininet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mininet for C++

The coolest networking library for C++

100% Complete and working.. I think... If you see a bug then create an issue. I doubt there are any bugs.

Simply include the mininet.hpp file :)

Build

Currently supports server/client for TCP/UDP - Unix and Windows support

Examples

Basic TCP (No need to stop the mininet processes before ending the program, I just do it to demonstrate that it exists :] )
Server

#include "mininet.hpp"
#include <iostream>
#include <string.h>

int main()
{
    TCPServer s(8080);
    s.accept();

    char buffer[1024] = { 0 };
    memset(buffer,0,1024);
    
    std::cout<<s.recv(0, buffer, sizeof(buffer))<<'\n'; //PRINT SIZE
    std::cout << buffer << std::endl; //PRINT RECIEVED DATA

    s.stop();
    return 0;
}

Client

  #include "mininet.hpp"

  int main()
  {
      TCPClient c("127.0.0.1", 8080);
      c.send("Arigato senpai!", 15);
      c.stop();
      return 0;
  }

Networking Memes :)

meow (this sneaky meow is added for readme structure reasons)

About

The coolest networking library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors