[已解决]如何作为新线程运行类的方法 [英] [ SOLVED ] How to run method of class ever as a new thread

查看:47
本文介绍了[已解决]如何作为新线程运行类的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。

我打算用WinSock写一个简单的聊天程序。

它应该是点对点的,所以每个程序都是服务器和客户端。 br />


我需要在一个新线程中运行一个方法。

我怎么能意识到这一点?



是否可以从该方法返回一些东西?



谢谢。



PS:我来自德国,所以不要怀疑是否有拼写错误或语法错误。



编辑:



在本网站上找到帮助: Multithreding教程

解决方案

将其发布以从未答复的列表中弹出。



OP在此帮助下自行解决:多线程教程 [ ^ ]

Hello.
I am going to write a simple chat programm with WinSock.
It should work peer-to-peer so each program is server and client.

I need to run a method ever in a new thread.
How can I realize this?

Is it possible to return something from that method?

Thanks.

P.S.: I''m from Germany, so don''t wonder if there are some spelling or grammatical mistakes.

EDIT:

Found help on this site: Multithreding tutorial

解决方案

Posting it to pop it out of unanswered list.

OP resolved it by himself with help from this: Multithreading Tutorial[^]


这篇关于[已解决]如何作为新线程运行类的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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