... even sockets are considered as files, and can be stored in a path in file system.
Not really. There are some sockets where the endpoint is represented by a file. These are UNIX domain sockets (AF_UNIX) and their is a variant which has a message semantic (SOCK_DGRAM) similar to UDP and one which has a stream semantic (SOCK_STREAM) similar to TCP.
But, UDP and TCP sockets have a no file representation in UNIX. They have a file descriptor though similar to normal files (and read and write system calls work with these), but they are not represented by a path in the file system.
There is also something like /dev/tcp/..
to deal with sockets inside the bash shell. But this is not an actual path on the file system either, but only a fancy syntax specific to the bash shell.
For more on this see also Wikipedia: Everything is a file which specifically notes:
... Therefore, a more accurate description of this feature is Everything is a file descriptor.