Home > Software design >  Does TCP has Response code system like HTTP response
Does TCP has Response code system like HTTP response

Time:03-24

Pardon me for my ignorance

HTTP Response code has this format

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

Does TCP has similar or any Response code system if yes how to access it ?

CodePudding user response:

TCP is a transport layer protocol and does not understand application level semantics. That would be provided by an application layer protocol like HTTP.

TCP is essentially a unix socket. So if you are looking for some kind of error codes, all the socket related error codes that your operating system gives you is what you should use. For example, Linux (POSIX) provides things like ENOENT, EIO, etc. For Linux see: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/tools/include/uapi/asm-generic/errno-base.h

CodePudding user response:

TCP is a bidirectional byte stream with no inherent semantics. There is no concept of a message in TCP and thus also not of requests or responses - and therefore also not response codes. Such semantics are added by the application protocols which use TCP as the transport layer.

CodePudding user response:

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

YES and NO

it sends socket signals like ECONNREFUSED .

  • Related