Forum Discussion
I found this discussion because I experience a similar problem (address already in use) trying to run vsim. Looking at the system calls made by vsim, it may be related to a host lookup, but I don't know why. It tries to bind the socket to a port itself already uses since a call made immediately beforehand. How can I find out what it's trying to do? What for is that socket connection? Excerpt from strace (it does more, including setting SO_REUSEADDR, but it doesn't seem to help):
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 11
...
setsockopt(11, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(11, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
getsockname(11, {sa_family=AF_INET, sin_port=htons(44223), sin_addr=inet_addr("127.0.0.1")}, [128->16]) = 0
listen(11, 128) = 0
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 12
...
setsockopt(12, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(12, {sa_family=AF_INET, sin_port=htons(44223), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EADDRINUSE
close(12) = 0
close(11) = 0
Regards,
Kolja