TCP有没有像HTTP响应那样的响应码系统

Does TCP has Response code system like HTTP response

原谅我的无知

HTTP 响应代码具有这种格式

1xx informational response – the request was received, continuing process
2xx successful – the request was successfully received, understood, and accepted
3xx redirection – further action needs to be taken in order to complete the request
4xx client error – the request contains bad syntax or cannot be fulfilled
5xx server error – the server failed to fulfil an apparently valid request

TCP是否有类似或任何响应码系统 如果是,如何访问它?

TCP 是一种没有固有语义的双向字节流。 TCP 中没有消息的概念,因此也没有请求或响应的概念——因此也没有响应代码。这种语义是由使用 TCP 作为传输层的应用程序协议添加的。

TCP 是传输层协议,不理解应用层语义。这将由 HTTP 等应用层协议提供。

TCP 本质上是一个 unix 套接字。因此,如果您正在寻找某种错误代码,您应该使用操作系统为您提供的所有与套接字相关的错误代码。例如,Linux (POSIX) 提供诸如 ENOENT、EIO 等内容。对于 Linux,请参阅:https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/tools/include/uapi/asm-generic/errno-base.h

https://docs.oracle.com/cd/E13203_01/tuxedo/msgq/msgq40a/mvscli/html/trouble.html

是和否

它发送类似 ECONNREFUSED 的套接字信号。