'Socket programming - does client's input/output stream differ from server's input/output stream?
When establishing a socket in order to achieve client/server communication socket is initialized at the client and at the server side. The way I understand this is that they have 1 FIFO bidirectional file. Now as far as I understood sockets, it means 1 input stream and 1 output stream of a single file, meaning if client is writing to its serverSocket.outputStream let's say, does it mean that server can't at the same time write to clientSocket.outputStream. Is serverSocket.outputStream and clientSocket.outputStream the same FIFO file or is it constructing 2 FIFO files, 1 for client and 1 for server meaning that clientSocket.outputStream and clientSocket.inputStream refer to different FIFO files. It came to be confusing since both streams refer to the same socket within a program and than I intuitively think it needs to be the same file, meaning that there is possibly a conflict if clientSocket.outputStream and serverSocket.outputStream write to this file at the same time. Could please someone help and clarify this? I wasn't able to understand it. Am I missing understanding of some underlaying important concept and if so which one?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
