I have a method called funct which i want to have as my callback function when i am using the beingreceive socket method in c#.
s.BeginReceive(buffer, 0, buffer.Length, System.Net.Sockets.SocketFlags.None,
new AsyncCallback(funct), null);
The error that am getting is:
No overload for 'funct' matches delegate 'System.AsyncCallback'
What might be the problem here?
"funct" must be a method with the following signature:
void funct(IAsyncResult ar) { }
You can't just use any method for your callback. The function has to have a specific signature (parameter list).
what is the funct? is it a delegate?
if it is, it's signature is not compatibile with AsyncCallback delegate.
funct must be a method looking like this:
void SomeMethod(IAsyncResult ar)
How does your 'funct' method signature looks like ?
Does it return void ?
Does it have exactly one parameter of type IAsyncResult ?
In other words, does your 'funct' method conform to the Asynccallback delegate ?