IRCaBot 2.1.0
GPLv3 © acetone, 2021-2022
#dev
/2022/11/11
~R4SAS
~villain
&N00B
+relaybot
AreEnn
Guest54224
Guest7650
Leopold
Most2
Nausicaa
Nikat
Opax
acetone
anontor
itsAMe
karamba_i2p
ncop
onon
orignal
poriori
profetikla
r00tobo
soos
teeth
tetrimer_
un
weko
колдырь
ian original: Hi bro, I cloned I2PTunnel.cpp, and wanted to modify functions like HandleAccept, I can modify them, but I don't want to do my code logic e.g server side code on there, I want to do from my Main.cpp, not the libi2pd, how is it possible to do? I have no idea, I researched, but can't find how to bind etc.
orignal implemenet you own I2P Tunnel
orignal more suitable for your app
orignal HandleAccept is just callback you pass to AcceptStreams
orignal it can be anything
` hypn, помнишь юзера, который тебя бомбил "интеграцией ш2зв с рш"? Вот сегодня написал на форуме ршном, что у него, понимаешь ли, падает рш если он собирает рш с BOB и без SAM. Вот такие пироги.
orignal так боб же уже выпилили из рш
orignal ian if you wish I can implement sync AcceptStream if it's easier for you than callbacks
` orignal, вот в будущей/следущей версии 0.6.7 будет так. И вот этот же юзер написал на форуме (только сейчас дошёл это этого поста), что, видиш ли, SAM нестабилен, поэтому BOB труъ.
orignal так надо не через боб а тоннель + сокс
orignal самое надежное
orignal и все работает
` Знает он про этот способ (спрашивал меня).
` У него идея фикс сделать ш2з в RetroShare как TOR - интегрированным решением.
` идея фикс в плане хотелки
orignal ужас какой
ian original: yes please, async AcceptStream would be helpful and easier to work with. Thanks.
orignal ian check last commit
orignal AcceptStream
orignal wait for new incoming stream
orignal can be with timeout
orignal if you need to cancel it call ResetAcceptor
ian orignal: thanks alot, that's exactly what I wanted :)
orignal please try I didn't have time to test it ))
ian const i2p::stream::StreamingDestination::Acceptor& myAcceptor(std::bind (&HandleAcceptMain, this, std::placeholders::_1));
ian myServerTunnel->GetLocalDestination()->AcceptStreams(myAcceptor);
ian orignal: this code, only works inside a class right?
ian I checked stackoverflow but they are all using std::bind from classes right?
orignal you have GetStreamingDestination () in ClientDestination
orignal no, you can pass any callback function with that signature
orignal why & in your code?
orignal const i2p::stream::StreamingDestination::Acceptor&
orignal you declare variable here why reference?
ian Sorry it was erroring out, I only pasted example.
ian I was trying understand your code.
orignal do you understand what is std::function ?
orignal do you understand what is lamda?
orignal std::bind produces std::function and lambda produces function
orignal and even C function produces std::function
ian Sorry I've only got basic knowledge of c++, but your i2pd application is a complex piece of code. Trying to learn more.
orignal yes, it uses many C++ things
orignal bascially C++1
orignal C++11
ian Yeah haha, you're an expert being able to code that big piece of software. I need to learn more anyway.
orignal I will write sample code of a server app
orignal but busy right now
orignal it will be not bigger than the client one
ian awesome thanks, take your time. Sorry again that I got basic knowledge of c++ and not more.