多线程服务器代码 [英] multithreaded server code

查看:116
本文介绍了多线程服务器代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在您之前的四份论文中都得到了答案,无论如何,还是希望与以后的互动进行展望

i hhave got the answer in your previous four submissions,thanks anyway,look fwd to future interactions

推荐答案

我们不做您的作业:一个理由.在这里,您可以考虑自己被告知的内容,并尝试理解它.也可以在那里,以便您的导师可以识别您的弱点,并将更多的注意力放在补救措施上.
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.


一些注意事项.

1.使用代码"格式,这样就不会全部左对齐.
2.在您的代码中的任何地方都看不到线程"一词.

还有一个可能的答案.

您要在应用程序中调用WSAStartup()吗?
我在您的代码示例中看不到它.
WSAStartup()初始化Windows套接字库.
A couple of notes.

1. Use the ''code'' formatting so it''s not all left aligned.
2. I don''t see the word ''thread'' anywhere in your code.

And a possible answer.

Are you calling WSAStartup() in your application?
I don''t see it in your code sample.
WSAStartup() initializes the windows socket libraries.


这是超越修复,因为您似乎不知道如何编写程序(至少到目前为止). .这不是多线程的,不是实际上用C ++编写的;没有尝试与多个客户端一起工作.这根本不是一个程序,因为您只是尝试在一个入口点函数main中编写所有内容.您甚至都没有尝试正确地以HTML格式设置代码格式,或者没有这样做.看起来像是如何编写代码的说明.

也许我会建议您查看任何著名且运作良好的开源C ++项目,以了解真正的开发人员是如何工作的.您需要学习很多东西;因为我们无法为您提供太多帮助,因为该论坛仅用于 Quick 问题与解答;答案.

我想知道:您的学校真的教过您什么吗?任务本身看起来很可疑:为什么要多达十个客户?如果您对问题的描述是正确的,则可能问题的作者并不真正知道如何正确解决问题.

—SA
This is beyond repair as it looks like you have no clue how to write programs in general — at least just yet. This is not multithreaded, not actually written in C++; nothing is attempted to work with multiple clients. And this is not very much of a program at all, because you just try to write everything in one entry-point function main. You did not even try to format your code in HTML properly or failed to do so. It looks like an illustration on how not to write code.

Perhaps I would recommend you to look at any famous and well-working open-source C++ project to see how real developers work. You need to learn a lot; as we cannot help you much, because this forum is just for Quick Questions & Answers.

I wonder: does you school really teaches you anything at all? The assignment itself looks suspicious: why up to ten clients? If your description of the problem is correct, it might be that the author of the problem does not really know how to solve it correctly.

—SA


这篇关于多线程服务器代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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