- Joined
- Mar 25, 2007
- Messages
- 126
- Reaction score
- 0
Ok, i have a server and it will process the data that it recieves, and instead of using a switch statement:
I am trying to invoke methods (i read it was alot faster):
But the problem is that it only executes the first piece of data that arrives and then it wont invoke the new data.
Can anyone help me please?
PHP:
public void Process(string DataArrived)
{
switch(DataArrived)
{
case "1":
---
break;
case "2":
---
break;
case "3":
---
break;
}
}
PHP:
public void Process(string DataArrived)
{
Functions Function = new Functions(this);
try
{
//The method to execute
MethodInfo Method = typeof(Functions).GetMethod(theData);
Method.Invoke(Function, null);
Write.Normal(Method.ToString());
}
catch
{
}
}
PHP:
Functions Function = new Functions(this) is the Functions class btw
Can anyone help me please?

