Twisted 发表于 2011-10-17 08:21:28

[1.298] Socket accept issue

本帖最后由 Twisted 于 2011-10-17 08:22 编辑

So lately a few people (and... servers, sadly) have been intent on keeping other servers down. One of these issues involves Ebenezer's socket count - when it goes over 1500, the system will break as it'll start ignoring (i.e. not accepting) any backlogged connections.

This means nobody else can connect until these connections are accepted, which it won't do because new connections won't trigger the FD_ACCEPT event/flag (until the backlogged ones are accepted).

So the fix? Easy really, just accept and close these excess connections so that the cycle can resume properly.# 0044424C    8D45 FC         LEA EAX,
# 0044424F    89D9            MOV ECX,EBX
# 00444251    50            PUSH EAX
# 00444252    8D45 C0         LEA EAX,
# 00444255    50            PUSH EAX
# 00444256    C745 FC 10000000 MOV DWORD PTR SS:,10
# 0044425D    FF76 04         PUSH DWORD PTR DS:
# 00444260    FF15 A0A36800   CALL DWORD PTR DS:
# 00444266    50            PUSH EAX
# 00444267    FF15 B8A36800   CALL DWORD PTR DS:
# 0044426D^ EB 9F         JMP SHORT 0044420E
# 0044426F    90            NOP
# 00444270    90            NOP
# 00444271    90            NOP
# 00444272    90            NOP
# 00444273    90            NOP
# 00444274    90            NOP
Although this will mean they don't break the server, it does mean they can still use up all of your sockets. You'll want to enforce your own limits on connections. You will still need to block access to these connections (but once they're disconnected, your server will be fine).

If you're not using Vista/Win7/Server 2008, wipfw can be very helpful in limiting connections per IP (i.e. a rule such as add allow tcp from any to me 15001 setup limit src-addr #, where # is the number of connections per source address allowed, and 15001 is your game server port).

If you are, however, I will probably write something up that you can use very soon. For the moment though, I find currports useful in identifying (and closing) spammed connections, especially with its filter support, i.e. a filter of include:local:tcp:15001 (where 15001 is your game server port), and Windows Firewall (yes! It IS actually very useful :P) in blocking them. I find Peerblock/Peerguardian somewhat useful, but considerably less efficient on newer operating systems. Windows Firewall is sufficient.

Don't let them take you down.
页: [1]
查看完整版本: [1.298] Socket accept issue