ahh, typing apf in ssh comes up with the help. my script uses port 51234 [really] on tcp.
So in order to open this port in APF, you need to edit /etc/apf/conf.apf and add the port number into the IG_TCP_CPORTS variable, if the port should be opened for incoming connections or into the EG_TCP_CPORT variable to allow outgoing connections to it. Bear in mind that you should be very careful editing conf.apf as if it gets broken, you can be locked out of the server. To apply the changes restart APF by executing "/etc/init.d/apf restart".