<andrea_>
There is a function 'input' that is the main inout function of tcp calls
<andrea_>
I'm wondering when this function would be actually called?
<hannes>
andrea_: this is correct, it is called by Flow.input, which in turn is called by the IP layer (in static_ipv4.ml there's another input, which receives the tcp input as callback), which is called by the ethif.ml
<andrea_>
interesting
<hannes>
andrea_: the glue for the stack is located in stack-direct/tcpip_stack_direct.ml in the functionlisten -- which is the one called by an application
<andrea_>
great answer, I will look at it in detail later and come back to this room for further discussion
<andrea_>
Thanks hannes
<hannes>
andrea_: disclaimer: i'm not the author of that tcpip
<hannes>
indeed, i've looked at it various times with things which were very unclear to me... and i'm slowly rewriting another tcp stack in ocaml ;)
<andrea_>
I think I've seen your comments in the code
<andrea_>
(* XXX: I've no clue why this is the way it is (10000 + Random ~bound:10000) -- hannes *)
<hannes>
yes, that was me from adjusting the stack to a new random number interface.... but unfortunately nobody answered
<hannes>
it seems to me that the original authors are busy with other things or consider it to be "finished" or "working"..
<andrea_>
finished is a bit unfair I guess, they might be busy with docker stuff!?
mort___ has quit [Quit: Leaving.]
abeaumont has quit [Ping timeout: 248 seconds]
mort___ has joined #mirage
AltGr has left #mirage [#mirage]
<andrea_>
hannes: I have a question about tcpip_stack_direct.ml if you are still there
mort___ has quit [Quit: Leaving.]
<hannes>
andrea_: i'm back
abeaumont has joined #mirage
argent_smith1 has quit [Quit: Leaving.]
argent_smith has joined #mirage
argent_smith1 has joined #mirage
argent_smith has quit [Ping timeout: 248 seconds]
argent_smith1 has quit [Ping timeout: 252 seconds]
<andrea_>
in tcpip_stack_direct.ml, function 'connect' calls 'Lwt.ignore_result (listen t)'. Since this call starts a listening thread in background, what happens if that thread exists unexpectedly? Caller will never find out
<andrea_>
hannes: ^
argent_smith has joined #mirage
argent_smith1 has joined #mirage
argent_smith has quit [Ping timeout: 258 seconds]
mort___ has joined #mirage
<hannes>
andrea_: that's true.
<hannes>
andrea_: I think the idea is that "listen t" should never fail... we worked towards using explicit result (error) values in Mirage-3, and don't use the error monad of Lwt anymore (at least that's the idea, I'm not sure whether there are still cases where Lwt.fail is used)
olle has joined #mirage
mort___ has quit [Quit: Leaving.]
olle has quit [Quit: olle]
<andrea_>
do you know how it is handled in mirage-3?
<hannes>
andrea_: as written in https://mirage.io/blog/announcing-mirage-30-release instead of having "read : t -> Cstruct.t Lwt.t", we now use "read : t -> (Cstruct.t, read_error) result Lwt.t" -- which means that the read_error is no longer embedded as Lwt.fail, but explicit (as Ok <data> or Error `Read_error in the code)