From ddfbbe55846bbd3bae923ddc41f3cedee179d067 Mon Sep 17 00:00:00 2001 From: rexy712 Date: Fri, 25 Jun 2021 10:57:02 -0700 Subject: [PATCH] Fix README's examples to include headers as they are installed in a given system --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3b2a517..fc9a5ed 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Frnetlib is tested on both Linux and Windows and currently supports: # Connecting to a Socket: ```c++ -#include +#include fr::TcpSocket socket; if(socket.connect("127.0.0.1", "8081", std::chrono::seconds(10)) != fr::Socket::Status::Success) @@ -27,8 +27,8 @@ Here, we create a new fr::TcpSocket and connect it to an address. Simple. fr::Tc # Listening and accepting connections: ```c++ -#include -#include +#include +#include fr::TcpListener listener; @@ -51,9 +51,9 @@ Here we create a new fr::TcpListener, which is used to listen for incoming conne # Using SSL ```c++ -#include -#include -#include +#include +#include +#include std::shared_ptr ssl_context(new fr::SSLContext()); //Creates a new 'SSL' context. This stores certificates and is shared between SSL enabled objects. ssl_conext->load_ca_certs_from_file(filepath); //This, or 'load_ca_certs_from_memory' should be called on the context, to load your SSL certificates. @@ -71,7 +71,7 @@ SSLListener accepts a lot more arguments than its unencrypted counterpart, TcpLi # Sending packets: ```c++ -#include +#include fr::Packet packet; packet << "Hello there, I am" << (float)1.2 << "years old"; @@ -101,8 +101,8 @@ Effectively the reverse of sending packets. We call fr::TcpSocket::receive, pass # A simple HTTP server: ```c++ -#include -#include +#include +#include fr::TcpSocket client; //fr::TcpSocket for HTTP. fr::SSLSocket for HTTPS. fr::TcpListener listener; //Use an fr::SSLListener if HTTPS. @@ -149,8 +149,8 @@ fr::HttpRequest objects are used for dealing with data being sent *to* the serve # A simple HTTP client: ```c++ -#include -#include +#include +#include //Connect to the website example.com on port 80, with a 10 second connection timeout fr::TcpSocket socket;