Got it compiling and somewhat working, except post.

This commit is contained in:
Brad Arant committed 2020-11-29 13:57:06 -08:00
1 parent 7ee13e87d2
commit bcea21cf96
12 files changed
+373 -133

No files matched your search

+9 -9
View File
@@ -4,23 +4,23 @@
#include "Exception.h"
namespace core {
TCPSocket::TCPSocket(EPoll &ePoll) : Socket(ePoll) {}
TCPSocket::TCPSocket(EPoll &ePoll, std::string text) : Socket(ePoll, text) {}
TCPSocket::~TCPSocket() {}
void TCPSocket::connect(IPAddress &address) {
setDescriptor(socket(AF_INET, SOCK_STREAM, 0));
if(::connect(getDescriptor(), (struct sockaddr *)&address.addr, address.addressLength) == -1)
throw coreutils::Exception("Error on connect to TCP socket.");
if(::connect(getDescriptor(), (struct sockaddr *)&address.addr, address.addressLength) == -1)
throw coreutils::Exception("Error on connect to TCP socket.");
}
void TCPSocket::output(std::stringstream &out) {
out << "|" << ipAddress.getClientAddressAndPort();
out << "|" << ipAddress.getClientAddressAndPort();
}
}