套接字和数据传输理论 [英] Sockets and data tranferring theory

查看:56
本文介绍了套接字和数据传输理论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,我是套接字的新手,我有一些关于客户的理论问题< - >服务器通信。



问题是关于消息类型和格式。



1.如果我将使用带有分隔符作为消息的字符串,对于所有客户端 - 服务器操作,对于高负载项目来说,这是一个好习惯吗?

例如:

CMSG_AUTH:登录:密码



2.我听说过,有人使用opcodes作为服务器返回命令。我应该串联使用字符串和操作码吗?如何?对于内部服务器架构,哪些设计模式会很好学习?

(我知道,这是一个愚蠢的问题,但我真的对服务器开发感兴趣,而且编写优秀,可扩展的服务器是我的梦想应用)。我不想使用WCF,我想从头开始,只是为了理解它是如何工作的。



2.哪些书很适合阅读当前主题?



谢谢!

Greetings, i'm new in Sockets, and i have a some theoretical questions regarding Client <-> Server communication.

Question is about message type and format.

1. If i will use a string with delimeters as a message, for all client-server operations, is it a good practice for a high load project?
Example:
"CMSG_AUTH:Login:Password"

2. I've heard, that somebody using opcodes as server return command. Should i use string and opcodes in tandem? And how? Which design patterns would be good to learn, for a internal server architecture?
(I know, it's a stupid question, but i really interested in server development, and it's my dream to write good, scalable server application). I don't want to use WCF, i want to make it from scratch, just to understand how it works.

2. Which books will be good to read reagarding current subject?

Thank you!

推荐答案

1。是的,只是HTTP的方式,所以没问题。

2.不确定我理解这个问题。您可以使用包含代码和文本的字符串作为响应;再次与HTTP相同。

2(再次)。不太确定但 UNIX网络编程 [ ^ ]包含大量有用信息。
1. Yes, just the way HTTP does it so no problem.
2. Not sure I understand the question. You can just use strings containing codes plus text as responses; again the same as HTTP.
2(again). Not really sure but UNIX Network Programming[^] contains a wealth of useful information.


这篇关于套接字和数据传输理论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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