Can someone please tell me how to do this?
I have a bank of phones. I only want to answer the phone if it is my friend Joe calling. How can I do that?
You can't. You have to know that the Arduino is connected to the port you are opening, or you have to open the port and ask if the Arduino is on the other end. Of course, in order to do that, the Arduino must be expecting the question, and provide the appropriate answer AND any other application already on the port can not be disturbed by your intrusion on the port.