minfrin commented on a change in pull request #8: URL: https://github.com/apache/tomcat-native/pull/8#discussion_r532263073
########## File path: native/src/network.c ########## @@ -316,6 +337,11 @@ TCN_IMPLEMENT_CALL(jint, Socket, bind)(TCN_STDARGS, jlong sock, TCN_ASSERT(sock != 0); TCN_ASSERT(s->sock != NULL); rv = (jint)apr_socket_bind(s->sock, a); + + apr_pool_cleanup_register(s->pool, (const void *)s, Review comment: REUSEADDR doesn't appear to work with UDS, alas. I went digging for best practice, and the thinking seems to be that deleting the file at startup is bad as it masks failures. I've gone with the delete-on-exit route. The create() function creates the socket pool, the bind() function creates the socket file and registers the socket cleanup, and the destroy() function runs the cleanup. APR itself will run the cleanup on shutdown as long as the java process exits, tomcat itself doesn't need to exit cleanly. If the java process crashes, the socket file needs to be manually deleted, this appears to be how this is handled elsewhere. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org