i know it’s not possible, i’m trying to understand the true reason behind it OS wise
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because the concept of a socket simply doesn’t map to the concept of a random-access in-memory array, which is the abstraction which
mmapgives you. A file on a block-device (disk) usually allows random read/write access. This maps nicely to an in-memory contiguous array, which also gives you random read/write access.A socket, however, is usually stream (or packet/datagram) oriented. Meaning, a stream of data gets sent over the socket, and a stream of data is received from the socket. But you can’t, for example, write/read to the Nth byte of an open socket stream – that simply doesn’t make any sense conceptually.