[erlang-questions] socket unrecv
Benoit Chesneau
bchesneau@REDACTED
Mon Jun 11 04:38:48 CEST 2012
On Sun, Jun 10, 2012 at 12:27 AM, CGS <cgsmcmlxxv@REDACTED> wrote:
> Hi Benoit,
>
> 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?
>
> 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).
>
> CGS
>
My case was a little more simpler here :) By API I meant another
internal code that wasn't supposed to be used by the initial code
doing the parsing and getting data from the socket.
Anyway I fixed it by rewriting the first part. It works well now :)
- benoît
More information about the erlang-questions
mailing list