<ipavlo>
Hi All! :) I've just started to learn both OCaml and Mirage. I'm trying to write some simplest tcp proxy and faced couple of issues: 1) Spacemacs and autocomplete for injected modules (Mirage_stack.V4). Can i fix this somehow?
ipavlo_ has joined #mirage
ipavlo has quit [Remote host closed the connection]
ipavlo_ has quit [Client Quit]
ipavlo has joined #mirage
<hannes>
ipavlo: unfortunately this is currently how it is. I sometimes manually do M-x merlin-use and list the packages needed in that buffer. alternatively, you could edit .merlin (which is generated/ overwritten by mirage configure iirc). with mirage4 (where dune will be used to build unikernels), this issue will vanish :)
<ipavlo>
Thx, I'll try that.
<ipavlo>
And second issue - how to actually send establish TCP connection and send data in socket? What I'm trying to do is listen on some port -> get data -> send same data on other port.
<ipavlo>
S.TCPV4.create_connection ?
<ipavlo>
What should i use to create connection?
<ipavlo>
If I have my module with S: Mirage_stack.V4
<hannes>
yes
<ipavlo>
I'm trying that but can't understand what should I pass as second arg? It requires "S.TCPV4.t"
<hannes>
(S.tcpv4 s)
<hannes>
so, S is the module of your stack, s is the value of your stack -- and tcp is a subcomponent of that stack -- S.TCPV4 is the module for that, (S.tcpv4 s) is the value of the tcp stack
Haudegen has quit [Quit: Bin weg.]
<ipavlo>
Oh, i'm starting to realize what is happening :) Thanks a lot!
<hannes>
you're welcome
<ipavlo>
hannes: it's finally working, thats my first functional program :) Is there some entry point where I can start to explore and use Mirage4 and use dune for building mirage apps? I just can't find anything on it :(
aedc has quit [Remote host closed the connection]
<hannes>
ipavlo: woohoo \o/ -- there's a PR https://github.com/mirage/mirage/pull/1153 but it is not quite ready yet, I'd suggest to wait another one or two weeks:)ODOD