mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 10:46:23 +00:00
more trying to reuse socket addresses when stuck.
This commit is contained in:
parent
fa8825a3ec
commit
844a480ae7
@ -99,6 +99,14 @@ int monitor_setup_sockets()
|
||||
return -1;
|
||||
}
|
||||
|
||||
int reuseP=1;
|
||||
if(setsockopt( monitor_named_socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
&reuseP, sizeof(reuseP)) < 0)
|
||||
{
|
||||
WHY("Could not indicate reuse addresses. Not necessarily a problem (yet)");
|
||||
WHY_perror("setsockopt");
|
||||
}
|
||||
|
||||
int send_buffer_size=64*1024;
|
||||
int res = setsockopt(monitor_named_socket, SOL_SOCKET, SO_RCVBUF,
|
||||
&send_buffer_size, sizeof(send_buffer_size));
|
||||
|
@ -48,6 +48,13 @@ int overlay_mdp_setup_sockets()
|
||||
mdp_abstract_socket = socket(AF_UNIX, SOCK_DGRAM, 0);
|
||||
if (mdp_abstract_socket>-1) {
|
||||
int dud=0;
|
||||
int reuseP=1;
|
||||
if(setsockopt( mdp_abstract_socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
&reuseP, sizeof(reuseP)) < 0)
|
||||
{
|
||||
WHY("Could not indicate reuse addresses. Not necessarily a problem (yet)");
|
||||
WHY_perror("setsockopt");
|
||||
}
|
||||
int r=bind(mdp_abstract_socket, (struct sockaddr *)&name, len);
|
||||
if (r) { dud=1; r=0; WHY("bind() of abstract name space socket failed (not an error on non-linux systems"); }
|
||||
if (dud) {
|
||||
@ -60,7 +67,6 @@ int overlay_mdp_setup_sockets()
|
||||
int res = setsockopt(mdp_abstract_socket, SOL_SOCKET, SO_SNDBUF,
|
||||
&send_buffer_size, sizeof(send_buffer_size));
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
if (mdp_named_socket==-1) {
|
||||
@ -72,6 +78,13 @@ int overlay_mdp_setup_sockets()
|
||||
mdp_named_socket = socket(AF_UNIX, SOCK_DGRAM, 0);
|
||||
if (mdp_named_socket>-1) {
|
||||
int dud=0;
|
||||
int reuseP=1;
|
||||
if(setsockopt( mdp_named_socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
&reuseP, sizeof(reuseP)) < 0)
|
||||
{
|
||||
WHY("Could not indicate reuse addresses. Not necessarily a problem (yet)");
|
||||
WHY_perror("setsockopt");
|
||||
}
|
||||
int r=bind(mdp_named_socket, (struct sockaddr *)&name, len);
|
||||
if (r) { dud=1; r=0; WHY("bind() of named unix domain socket failed"); }
|
||||
if (dud) {
|
||||
|
Loading…
Reference in New Issue
Block a user