回调函数 [英] Callback Function

查看:224
本文介绍了回调函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个称为funct的方法,当我在c#中使用bereceive套接字方法时,我想要作为我的回调函数。

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);

得到的错误是:


没有重载'funct'匹配委托'System.AsyncCallback'

No overload for 'funct' matches delegate 'System.AsyncCallback'

推荐答案

funct必须是具有以下签名的方法:

"funct" must be a method with the following signature:

void funct(IAsyncResult ar) { }

这篇关于回调函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆