0

Suppose we have two process having the same port, but one at a time one will be using it and other one will be in passive mode and once the active process goes down, the passive will start reading from the port.

now since in linux everything is a file descriptor, i wanted to know is there any way where passive process can immediately start reading from the port.

Currently i am closing the port in active process and then again open it in the passive once it becomes active.

Thanks in advance.

  • possible duplicate of [Can two applications listen to the same port?](http://stackoverflow.com/questions/1694144/can-two-applications-listen-to-the-same-port) – Joey Jul 18 '13 at 08:10

1 Answers1

0

No, only one process can read from a port at a time. Even on linux, when a process uses the port, it locks it. It is linux architecture that everything is a file(with exception of network devices). But these device files(or ports) are special files or device files. You cannot manipulate them as normal files.

user2550754
  • 884
  • 8
  • 15