I am trying to open a connection on a machine both ways. That is I am trying to open say the port 8001 and I did this.
iptables -A INPUT -p tcp --dport 8001 -j ACCEPT
Now how to configure so the server lets the outgoing packets generated by the program listening on 8001.