<div dir="ltr"><div>Hi,</div><div><br></div><div>We have a situation where gen_udp:send/4 does not return ok and it just hangs and the process is waiting indefinitely. <br></div><div><br></div><div>e.g.<br></div><div> {current_function,{prim_inet,sendto,4}},<br> {initial_call,{proc_lib,init_p,5}},<br> {status,running},<br> {message_queue_len,15363062},</div><div><br></div><div>The send buffer size on the socket is around 200KB. <br></div><div><br></div><div>3> inet:getopts(S, [sndbuf]).<br>{ok,[{sndbuf,212992}]}</div><div><br></div><div>The UDP socket doesn't receive any incoming packets so it is used for sending only. Running R21-3 with redhat 7.5. Would like to ask the group under which conditions will the port not come back with inet_reply? I assume if the sndbuf is full then it should come back with 
<span class="gmail-code">enobufs</span> or some sort but it should be quick enough to flush the sndbuf to interface.<br></div><div><br></div><div>In prim_inet:sendTo/4, it always expect inet reply from OS but it never comes and never times out.<br></div><div><br></div><div>try erlang:port_command(S, PortCommandData) of<br>                        true -><br>                            receive<br>                                {inet_reply,S,Reply} -><br>                                    ?DBG_FORMAT(<br>                                       "prim_inet:sendto() -> ~p~n", [Reply]),<br>                                    Reply<br>                            end<br>                    catch</div><div><br></div><div>Thanks<br></div></div>