Comments (4)
Hmm... nntp-proxy doesn't use UDP weird?? maybe some libevent voodo?
from nntp-proxy.
libevent before version 2.1 is using UDP socket to detect IPv6 WTF see 1.7
https://raw.github.com/libevent/libevent/master/whatsnew-2.1.txt
from nntp-proxy.
The nntp-proxy does not explicitly open an UDP socket. The bufferevent_socket_connect_hostname function will open such a socket when contacting a DNS server during a hostname resolution.
Using strace, you can observe the following behaviour:
open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=71, ...}) = 0
read(6, "nameserver 127.0.0.1\nnameserver "..., 71) = 71
close(6) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 6
fcntl64(6, F_GETFD) = 0
fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
fcntl64(6, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(6, F_SETFL, O_RDWR|O_NONBLOCK) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN, {u32=6, u64=6}}) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 7
fcntl64(7, F_GETFD) = 0
fcntl64(7, F_SETFD, FD_CLOEXEC) = 0
fcntl64(7, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(7, F_SETFL, O_RDWR|O_NONBLOCK) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN, {u32=7, u64=7}}) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 8
fcntl64(8, F_GETFD) = 0
fcntl64(8, F_SETFD, FD_CLOEXEC) = 0
fcntl64(8, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(8, F_SETFL, O_RDWR|O_NONBLOCK) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN, {u32=8, u64=8}}) = 0
So I suppose that libevent opens a SOCK_DGRAM socket for each DNS server in /etc/resolv.conf, then calls epoll on those sockets for providing asynchronous DNS resolution.
You can try to comment one of the three servers in /etc/resolv.conf, restart nntp-proxy and see if the number of opened UDP sockets has diminished.
from nntp-proxy.
So I went the other way and added a 4th nameserver to /etc/resolv.conf.
This seems to confirm the proposed answer:
netstat -lnptu | grep nntp-proxy | grep udp
udp 0 0 0.0.0.0:53134 0.0.0.0:* 32614/nntp-proxy
udp 0 0 0.0.0.0:56476 0.0.0.0:* 32614/nntp-proxy
udp 0 0 0.0.0.0:36920 0.0.0.0:* 32614/nntp-proxy
udp 0 0 0.0.0.0:36569 0.0.0.0:* 32614/nntp-proxy
from nntp-proxy.
Related Issues (12)
- Program received signal SIGPIPE, Broken pipe. HOT 2
- Error in make ? HOT 1
- disable SSL HOT 1
- Userauth with mysql
- Automatically disconnect connection for user?
- Keep parent connections open
- Still maintained ? HOT 1
- I dont have libevent2 HOT 1
- Unable to logon SSL SSL23_GET_CLIENT_HELLO HOT 15
- Multiple servers HOT 5
- Disable posting access, only allow download ?? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nntp-proxy.