P2P connection Limiting to users TCP and UDP

I have read several example here for limiting connections to cusotmers, but cannot get any to work. I am generally against limiting the cusotmer unless i need to, but these P2P clients are nasty, I watched one customer with 500 open connections both UDP and TCP on random ports, and hardly any of them were caught by the p2p-all setting in the queues or filters.
So I would like to set it up so that each customer can have X number of open tcp or udp connections, and see if that works well. and would also like to set it so that P2P clients can only upload at 64kbps and download no more than 256kbps, per customer

Anyone have some good examples I can use?

You may set limit for TCP connections (openened per user),
http://www.mikrotik.com/docs/ros/2.9/ip/filter
You can’t set limit UDP connections,

Use mangle, mark p2p packets with one mark and another mark for other traffic, set queues accordingly.

I have tcp rules that seem to be working good now, however, I was wondering..

Is there a way to limit a certain udp port from being open X number of times.

for example if a client has 500 incoming udp connections on port 32789 is can i limit port 32789 to only 10 somehow? Is there a way to mark and count the connections then limit them that way?

Thanks in advance for any advice anyone has on this…

dont forget that there are encrypted p2p traffic, and that type cannot be detected sue to encryption - that way you need un decrypt it to detect weather it is or is not p2p packet.

for example torrent p2p networks now widely use clients that encrypt traffic, but client can choose weather it uses only encrypted, only un-encrypted or as available.