http://bugs.winehq.org/show_bug.cgi?id=13474
Summary: Network sockets: Unable to create two server sockets in the same wine session Product: Wine Version: 1.0-rc2 Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: winsock AssignedTo: wine-bugs@winehq.org ReportedBy: yiourkas@gmail.com
I was having some issues while running warcraft III online. I noticed that I only received message from some players and not from everyone. I investigated a little bit into this.
It seems that within the same wine session, you cannot bind the same port twice, even if the first server socket is closed.
I created a test program which had the following flow:
Create a server socket Accept a socket connection by a client (telnet on linux in my case) --do some stuff-- Close the client socket, close the server socket Create another server socket bound on the same port
At this point I get an exception that the address is already used, however no one is using it (telnet on linux replies with connection refused)
I don't know what else I have to paste in order to help you.
http://bugs.winehq.org/show_bug.cgi?id=13474
--- Comment #1 from Kai Blin kai.blin@gmail.com 2008-05-27 09:22:38 --- Interesting, can you give me a +winsock trace of this?
WINEDEBUG=+winsock wine app.exe 2> winsock.txt
http://bugs.winehq.org/show_bug.cgi?id=13474
--- Comment #2 from yiourkas yiourkas@gmail.com 2008-05-27 10:24:03 --- Created an attachment (id=13401) --> (http://bugs.winehq.org/attachment.cgi?id=13401) +winsock trace of a sample application
http://bugs.winehq.org/show_bug.cgi?id=13474
--- Comment #3 from yiourkas yiourkas@gmail.com 2008-05-27 10:25:59 --- (From update of attachment 13401) Trace Attached.
As you will see, it is java application, but I guess this makes no difference, since happens in warcraft 3 too
http://bugs.winehq.org/show_bug.cgi?id=13474
--- Comment #4 from yiourkas yiourkas@gmail.com 2008-05-27 14:45:43 --- Bug 12889 (http://bugs.winehq.org/show_bug.cgi?id=12889) contains the same issue too
http://bugs.winehq.org/show_bug.cgi?id=13474
Kai Blin kai.blin@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |oscar.rentzhog@gmail.com
--- Comment #5 from Kai Blin kai.blin@gmail.com 2008-05-27 17:03:32 --- *** Bug 12889 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=13474
--- Comment #6 from Kai Blin kai.blin@gmail.com 2008-05-27 17:08:47 --- Can you retry this with a port > 1024? You're not allowed to bind to that port as unprivileged user.
Also, I'd be interested if WC3 tries to do a setsockopt(SO_REUSE) on that socket.
http://bugs.winehq.org/show_bug.cgi?id=13474
yiourkas yiourkas@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #13401|0 |1 is obsolete| |
--- Comment #7 from yiourkas yiourkas@gmail.com 2008-05-28 04:37:48 --- Created an attachment (id=13427) --> (http://bugs.winehq.org/attachment.cgi?id=13427) +winsock trace of a sample application using port > 1024
I thought that I could bind to any port >= 1024.
Anyway, the issue is that the first time I setup a server socket, everything works great. Once I close this server socket and try to bind another socket to this port I get the Address already in use error.
Also, as claimed in bug 12889, there is no such issue in version 0.9.43
http://bugs.winehq.org/show_bug.cgi?id=13474
--- Comment #8 from yiourkas yiourkas@gmail.com 2008-05-28 04:55:55 --- another note: Ok, concerning winsock, **I think** this is an issue.
Concerning warcraft, and to whoever wants to play in battle.net and see ALL the player's messages:
a) You cannot be the host of the game. Warcraft creates a server socket on port 6112 (used by war3) when creating the game (there is a procedure to register the game to battle.net's servers). Then closes the ssocket and attempts to create another one for the players to connect.
b) Firewall port 6112, for example remove NAT on your router and you will be able to see other player's messages.
What I 've figured about battle.net is that, except from the host of the game, everyone else having port 6112 exposed can act as a backup host. Again, what I think happens is that every backup host tries to open a server socket and connect with all other players (this looks like a fully connected graph of up to 12 nodes if all nodes have port 6112 exposed). If you explicitly deny being a backup host (by firewalling port 6112), warcraft uses only one client socket to connect to the main game host.
http://bugs.winehq.org/show_bug.cgi?id=13474
--- Comment #9 from Kai Blin kai.blin@gmail.com 2008-06-22 02:27:02 --- Does your winsock app use SO_REUSEADDR for the server socket? Can you attach the code of your sample application?
http://bugs.winehq.org/show_bug.cgi?id=13474
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |ABANDONED
--- Comment #10 from Austin English austinenglish@gmail.com 2008-12-23 07:24:15 --- Abandoned.
http://bugs.winehq.org/show_bug.cgi?id=13474
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Austin English austinenglish@gmail.com 2008-12-23 07:24:55 --- Closing.