Skip to content
Snippets Groups Projects

Implements #89 PNG chunking

Merged Nicolas Pope requested to merge feature/89/chunking into master
@@ -85,8 +85,8 @@ static SOCKET tcpConnect(URI &uri) {
return INVALID_SOCKET;
}
int flags =1;
if (setsockopt(csocket, IPPROTO_TCP, TCP_NODELAY, (const char *)&flags, sizeof(flags))) { LOG(ERROR) << "ERROR: setsocketopt(), TCP_NODELAY"; };
//int flags =1;
//if (setsockopt(csocket, IPPROTO_TCP, TCP_NODELAY, (const char *)&flags, sizeof(flags))) { LOG(ERROR) << "ERROR: setsocketopt(), TCP_NODELAY"; };
addrinfo hints = {}, *addrs;
hints.ai_family = AF_INET;
@@ -169,8 +169,8 @@ Peer::Peer(SOCKET s, Universe *u, Dispatcher *d) : sock_(s), can_reconnect_(fals
is_waiting_ = true;
scheme_ = ftl::URI::SCHEME_TCP;
int flags =1;
if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (const char *)&flags, sizeof(flags))) { LOG(ERROR) << "ERROR: setsocketopt(), TCP_NODELAY"; };
//int flags =1;
//if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (const char *)&flags, sizeof(flags))) { LOG(ERROR) << "ERROR: setsocketopt(), TCP_NODELAY"; };
// Send the initiating handshake if valid
if (status_ == kConnecting) {
@@ -596,13 +596,15 @@ int Peer::_send() {
vector<WSABUF> wsabuf(send_size);
for (int i = 0; i < send_size; i++) {
wsabuf[i].len = send_vec[i].iov_len;
wsabuf[i].len = (ULONG)send_vec[i].iov_len;
wsabuf[i].buf = (char*)send_vec[i].iov_base;
//c += ftl::net::internal::send(sock_, (char*)send_vec[i].iov_base, (int)send_vec[i].iov_len, 0);
}
int bytessent;
int c = WSASend(sock_, wsabuf.data(), send_size, &bytessent, 0, NULL, NULL);
DWORD bytessent;
LOG(INFO) << "About to send: " << send_size;
int c = WSASend(sock_, wsabuf.data(), send_size, (LPDWORD)&bytessent, 0, NULL, NULL);
LOG(INFO) << "Fin send";
#else
int c = ftl::net::internal::writev(sock_, send_buf_.vector(), (int)send_buf_.vector_size());
#endif
Loading