使用curl类可以实现http客户端,在有些游戏服务器中会用到,应用场景一般为向第三方游戏平台请求一些信息,比如当接入腾讯游戏平台,与金子相关的操作一般需要向腾讯方发起相关的请求,idip操作等。
1. 使用CURLOPT_WRITEDATA设置回调函数中的返回值。
2. 使用CURLOPT_WRITEFUNCTION设置回调函数。
3. curl_easy_perform是阻塞式的。
参考资料:
https://www.cnblogs.com/alfred0311/p/7988648.html
https://www.jianshu.com/p/c286f9c25c94
https://blog.csdn.net/Ivan_Xing/article/details/79778077
https://curl.haxx.se/libcurl/c/curl_easy_perform.html
https://blog.csdn.net/u011857683/article/details/53069268
https://blog.51cto.com/fengyuzaitu/2394813?source=dra
http://www.360doc.com/content/16/0107/15/18578054_526158476.shtml
https://blog.csdn.net/tao_627/article/details/40082101
https://curl.haxx.se/libcurl/c/CURLOPT_WRITEDATA.html
https://blog.csdn.net/shang_cm/article/details/77938309
https://blog.csdn.net/lyc201219/article/details/62045536