[erlang-questions] about socket problem

Rapsey rapsey@REDACTED
Tue Sep 1 10:58:26 CEST 2009


That is just how sockets work I'm afraid. No matter what language you are
using. If your server/client are on the same computer you will get a
notification that the socket was closed, but not when  you're communicating
over the internet. The only way around is to ping the other side every once
in a while.


Sergej


On Tue, Sep 1, 2009 at 5:52 AM, Yu-Teh Shen <shenyute@REDACTED> wrote:

> I got a question about erlang socket.
>
> Now I have a server(written by erlang) and a client(written by C).
>
> Client create a socket connection to server and then idle for a long time.
>
> After that, I kill client process, but I found out that the server didn't
> know client was been killed!
>
> And I use netstat -pan in server, the connection is still exist!
>
> Is there anyway, the server can detect client had been killed? Like using
> poll function in C socket (error code POLLERR or POLLHUP)
>
> Thanks a lot!
>
>
> Shen, Yu-Teh
>


More information about the erlang-questions mailing list