Hi Benoit,<div><br></div><div>Forgive my lack of imagination, but how do you manage to listen to the same socket with another process? Can you pass the socket from the other API? Moreover, how do you make the other API to listen after your one without putting it in front of the other API?</div>
<div><br></div><div>If you can access and pass the socket from the other API, I think you can bounce back the data toward the same socket (gen_tcp:send/2) because then the other API should receive the same data as the original transmitter (hopefully, the other side won't crash because it doesn't expect reply). But, still, this is only in the case you can receive the packets in the same time with the other API and the other API trashes the original packets (otherwise you just double the data in the other API).</div>
<div><br></div><div>CGS</div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Sat, Jun 9, 2012 at 4:13 PM, Benoit Chesneau <span dir="ltr"><<a href="mailto:bchesneau@gmail.com" target="_blank">bchesneau@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">gen_tcp has the undocumented function `unrecv/2` which is using<br>
`inet(6)_tcp:unrecv/2` but I don't see the equivalent in the SSL<br>
module.<br>
<br>
Is there any way in the standard library to fill a buffer in the socket ?<br>
<br>
My use case is the following: I have an api that read some data from<br>
the socket then pase it and keeps the rest in a buffer. Now I want to<br>
use this buffer with another API that only read from the socket. I<br>
could of course make a change in this API to read the data from a<br>
buffer if it`s available, but since I don't control this API it will<br>
make some time to have this change included. So rather to say to<br>
others to use my own patched API in between, I could use this trick.<br>
<br>
So if there is a way to put back the data in the socket pid ?<br>
<br>
- benoît<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>