是否存在仅遵循请求模型的协议?

Does there exist any protocol which follows only request model?

HTTP 遵循 request-response model,即客户端的每个请求都会有服务器的响应。

是否存在仅遵循 请求 模型的协议(只有来自客户端的请求)?

我知道 SMTP。我可以将 SMTP 视为仅请求模型,因为我们正在发送邮件但未收到服务器的任何响应吗?

如果还有其他这样的协议,请说明。我用谷歌搜索但没有找到与我的特定查询相关的任何答案。

Can I consider SMTP as request only model because we are sending the mail but not receiving any response from server?

不,因为对于客户端发送到 SMTP 服务器的每个命令,客户端都会得到响应。 SMTP 比 HTTP 更 chattier。仅发送一封电子邮件,SMTP 服务器和客户端至少要相互通信 5 次。

这是 SMTP 的工作原理:

Client: EHLO yourdomain.com
Server: 250 smtp.gmail.com

Client: MAIL FROM: you@yourdomain.com
Server: 250 Ok

Client: RCPT TO: someone@gmail.com
Server: 250 Ok

Client: DATA
Server: 354 Start mail input; end with <CRLF>.<CRLF>

Client: Hey how are you?
Client: .
Server: 250 Ok

Client: QUIT
Server: 221 smtp.gmail.com Closing connection. Goodbye!

如你所见,这也是一个请求-响应协议。

但是您链接的维基百科页面说 SMTP 是一种单向协议,这是错误的。


Does there exist any protocol that follows only request model (there will be only requests from client)?

大多数协议都用于交换数据,这就是它们遵循请求-响应模型的原因。客户端想要查看一个页面,因此他向服务器请求它,然后服务器发送该页面作为响应。正在服务器和客户端之间交换数据。

但如果你愿意,你可以编写一个只有一种方式的协议。