[erlang-questions] Diameter service activation/deactivation timeout

Łukasz Biedrycki lukasz.biedrycki@REDACTED
Thu Sep 10 21:36:30 CEST 2015


Hi Kirill,

I believe that the option you are looking for is
​​
SO_LINGER
​.
​I​
n Erlang it is {linger, {boolean(), integer() >= 0}}
​​.
In your case one of the transport_config option.​

I recommend this article:
http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html
which explains in details how and when to use this option.

I hope that helps. Btw what OS are you using?

Cheers,
Lukasz

On Thu, Sep 10, 2015 at 9:40 AM, Kirill Ratkin <kvratkin@REDACTED> wrote:

> Hi,
>
> I have two functions listed below:
>
> service_start(Name) ->
> %% ... skipped some preparation steps for service activation
>     Opts = [{'Origin-Host', atom_to_list(Name) ++ ".example.com"},
>                {'Origin-Realm', "example.com"},
>                {'Vendor-Id', ?VENDOR_ID},
>                {'Product-Name', "Just Diameter Server"},
>                {'Auth-Application-Id', Ids}] ++ Apps,
>
>     TransportOpts =  [{transport_module, T},
>                       {transport_config, [{reuseaddr, true},
>                                           {ip, IP},
>                                           {port, P}]}],
>     diameter:start_service(Name, Opts),
>     diameter:add_transport(Name, {listen, TransportOpts}),
>     diameter:subscribe(Name).
>
>
> service_stop(Name) ->
>     diameter:unsubscribe(Name),
>     diameter:remove_transport(Name, true),
>     diameter:stop_service(Name).
>
> When I do service_start the Port is listen to incoming messages.
> Then I want to stop service. (there are no clients connected to service)
> I do 'service_stop' and diameter:services() says '[]'. So there aren't any
> active services.
> But 'netstat' shows port is in LISTEN state:
> tcp        0      0 127.0.0.1:3868         0.0.0.0:*               LISTEN
> After about 30 seconds port is closed.
>
> It seems 30 secs is too long ... How can I configure this timeout?
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150910/ebbee3b0/attachment.htm>


More information about the erlang-questions mailing list