RDFS
The Rice Comp413 2017 class' continuation on the work of the 2016 RDFS.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
socket_writes.h
1 // Copyright 2017 Rice University, COMP 413 2017
2 
3 #include <netinet/in.h>
4 #include <string>
5 #include <iostream>
6 #include <asio.hpp>
7 
8 #include <ProtobufRpcEngine.pb.h>
9 
10 #pragma once
11 
12 using asio::ip::tcp;
13 
14 namespace rpcserver {
19 bool write_int32(tcp::socket &sock, uint32_t val);
24 bool write_int16(tcp::socket &sock, uint16_t val);
29 bool write_byte(tcp::socket &sock, unsigned char byte);
34 bool write_varint(tcp::socket &sock, uint32_t val);
39 bool write_proto(tcp::socket &sock, std::string &proto_bytes);
44 bool write_delimited_proto(tcp::socket &sock, std::string &proto_bytes);
45 } // namespace rpcserver