ok implement libuv stubs for tcp connectors

This commit is contained in:
Rick V 2019-10-16 21:52:18 -05:00
parent b473f17231
commit 33378b2c0c
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465
2 changed files with 15 additions and 2 deletions

View File

@ -278,6 +278,19 @@ namespace llarp
return uwrite(fd, (char*)buf, sz);
}
std::deque< std::vector< char > > m_WriteQueue;
static ssize_t
TCPWrite(llarp_tcp_conn* conn, const byte_t* ptr, size_t sz)
{
llarp::ev_io* io = (llarp::ev_io*)conn->impl;
m_WriteQueue.emplace_back(sz);
std::copy_n(ptr, sz, m_WriteQueue.back().begin());
byte_t* buf = new byte_t[sz];
memcpy(buf, m_WriteQueue.back().data(), sz);
return uwrite(io->fd, (char*)buf, sz);
}
void
tcp_conn::connect()
{
@ -430,6 +443,7 @@ llarp_win32_loop::tcp_connect(struct llarp_tcp_connecter* tcp,
if(fd == -1)
return false;
llarp::tcp_conn* conn = new llarp::tcp_conn(this, fd, remoteaddr, tcp);
conn->tcp.write = &llarp::TCPWrite;
add_ev(conn, true);
conn->connect();
return true;

View File

@ -88,8 +88,7 @@ Source: "{#DevPath}ui-win32\bin\release\lokinetui.pdb"; DestDir: "{app}"; Flags:
#endif
; eh, might as well ship the 32-bit port of everything else
Source: "{#DevPath}build\testAll.exe"; DestDir: "{app}"; Flags: ignoreversion
; we don't ship this yet
; Source: "{#DevPath}build\lokinetctl.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#DevPath}build\lokinetctl.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "LICENSE"; DestDir: "{app}"; Flags: ignoreversion
Source: "lokinet-bootstrap.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "rootcerts.pem"; DestDir: "{app}"; Flags: ignoreversion