Skip to content

dgercho/socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socket

Simple TCP socket wrapper class for C++. Runs on Windows, Linux and macOS.

How to use it?

Copy the the files from src to your project (socket.cpp and socket.h), and include the header file.

Example Workflow

    #include <src/socket.h>
    #include <string>

    int main() {

        //Create a socket
        Socket sock = Socket();
        sock.connect("127.0.0.1", 8000);

        //Send data
        std::string data_to_send = "Hello world :S";
        sock.send(data_to_send.data(),data_to_send.size());

        sock.close();
        return 0;
    }

About

Socket wrapper class for CPP

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published