kopia lustrzana https://github.com/stlink-org/stlink
Use SO_REUSEADDR socket option to allow binding after ^C.
rodzic
db2744519e
commit
db0a8d3ddf
|
@ -52,6 +52,9 @@ int serve(struct stlink* sl, int port) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
unsigned int val = 1;
|
||||
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val));
|
||||
|
||||
struct sockaddr_in serv_addr = {0};
|
||||
serv_addr.sin_family = AF_INET;
|
||||
serv_addr.sin_addr.s_addr = INADDR_ANY;
|
||||
|
|
Ładowanie…
Reference in New Issue