mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-31 09:20:21 +00:00
ok implement libuv stubs for tcp connectors
This commit is contained in:
parent
b473f17231
commit
33378b2c0c
@ -278,6 +278,19 @@ namespace llarp
|
|||||||
return uwrite(fd, (char*)buf, sz);
|
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
|
void
|
||||||
tcp_conn::connect()
|
tcp_conn::connect()
|
||||||
{
|
{
|
||||||
@ -430,6 +443,7 @@ llarp_win32_loop::tcp_connect(struct llarp_tcp_connecter* tcp,
|
|||||||
if(fd == -1)
|
if(fd == -1)
|
||||||
return false;
|
return false;
|
||||||
llarp::tcp_conn* conn = new llarp::tcp_conn(this, fd, remoteaddr, tcp);
|
llarp::tcp_conn* conn = new llarp::tcp_conn(this, fd, remoteaddr, tcp);
|
||||||
|
conn->tcp.write = &llarp::TCPWrite;
|
||||||
add_ev(conn, true);
|
add_ev(conn, true);
|
||||||
conn->connect();
|
conn->connect();
|
||||||
return true;
|
return true;
|
||||||
|
@ -88,8 +88,7 @@ Source: "{#DevPath}ui-win32\bin\release\lokinetui.pdb"; DestDir: "{app}"; Flags:
|
|||||||
#endif
|
#endif
|
||||||
; eh, might as well ship the 32-bit port of everything else
|
; eh, might as well ship the 32-bit port of everything else
|
||||||
Source: "{#DevPath}build\testAll.exe"; DestDir: "{app}"; Flags: ignoreversion
|
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: "LICENSE"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "lokinet-bootstrap.exe"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "lokinet-bootstrap.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "rootcerts.pem"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "rootcerts.pem"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Loading…
Reference in New Issue
Block a user