- I identified how to put a new module into the system.
- I experimented with creating a new module.
- I added the new module to the system (after troubleshooting a problem).
At this point, megaphone seems to start up when something tries to connect to the server, but the connection closes immediately. For the code:
gen_tcp:recv(Socket, 0)
I was getting the result:
{error, closed}
Poking about on the net a bit came up with this article:
Long story short, the calling erlang process was terminating, which automagically closes all TCP connections associated with it. The solution was to call:
gen_tcp:controlling_process(Socket, Pid)
Which tells erlang that the process associated with the socket is something different from what it was originally using.
Next step, everything will work.
Magically.
Really.
No comments:
Post a Comment