I'm trying to write a dictionary for delegates that when specific values are passed so I can invoke the delegate.
Currently code is written with a switch wanted todo with delegates though.
EX: Socks 5 packet is received, It calls the packet handler, Packet handle will check if packet exists in dictionary and invoke the delegate associated with it.
When this delegate is invoked I need it to know the object of the client so it's executing on correct client. So I need a way to pass what client/connection it is currently invoking this on, Non-static objects that are instantiated when a connection is made.
I would like to do this without using static functions and passing objects as parameter.
Sorry if this don't make sense not sure how to explain what I'm trying todo.