Thanks for the feedback. I haven't gotten to that level of analysis
yet, because I was more focused on a nice working solution up front, but
will start digging deeper. Really however, the call to Sleep() is just
an added bonus. The fix works fine without it, you just get some frame
rate drop whenever the client is acting up (I have a quad core, so I
don't know what the impact is for dual or single core users). I would
be happy to leave it out if we could get a fix in the wine mainline for
now while digging deeper into what's causing it.
The main problem is the production of thousands of small and identical
udp packets essentially causing a DoS attack on their server and bogging
down the upstream traffic for the user. In one test, 8500x 62 byte
packets (size includes headers) were sent in 500 mS. Some users have
also reported problems where their routers don't seem to handle the
flood very well (crashing, etc.). It's an intermittent problem and only
occurs while one's character is in specific locations in the game
world. I'm also not certain that every Linux user experiences this
problem and the degree will certainly vary depending upon their bandwidth.
Rob Shearman wrote:
2008/7/16 Daniel Santos <[EMAIL PROTECTED]>:
+ if(_lotro_hack_enabled
+ && to->sa_family == AF_INET
+ && dwBufferCount == 1
+ && _lotro_hack(&get_per_thread_data()->lotro_msgs,
+ s, lpBuffers, (struct WS_sockaddr_in*)to)) {
+ Sleep(10);
+ if(lpNumberOfBytesSent) {
+ *lpNumberOfBytesSent = lpBuffers->len;
+ }
+ return 0;
+ }
+
Hi Daniel,
While I appreciate the effort you've gone to to fix a bug, I don't see
any analysis in the bug that suggests this is the only possible
solution. It seems to me as though LOTRO is calling WSASendTo in a
tight loop and that it isn't such a tight loop on Windows. A +relay
log will reveal which calls it is making in that thread. You can then
build a similar test program and time how long each call takes on
Windows and Wine and see where the difference is (although it probably
won't be as simple as that as there will be other threads interacting
in LOTRO). At a guess, it might simply be that Windows yields to other
threads after making a call to a network function.