Thanks for the input Tom and Louis.
To answer your questions Tom, I am opening and closing the TCP connections each time I send something to the printer.
Also, there aren't more printjobs but there seems to be alot more network traffic than previously and I haven't tried to monitor the number of socket connections using netstat only the number of socket connections on my MySQL database. - BUT I will definately be monitoring them now!
From what you have both said i think one of two things might be happening.
1. As I open a seperate TCP connection and port each time I connect to my printer, I end up using too many ports and no more ports can be allocated so I can't communicate to the printers anymore until I clear out all the unused ports by restarting my apps.
OR
2. On one call to the printer, I fail to close the TCP Connection succesfully to the printer so the next time I try to connect to the printer, it throws me out as it thinks it already has a connection established waiting to be used.
I think that this might be more likely as there has been a rewiring of the network recently and from other projects in the same area, it looks like one side of the network (including where my printers are) is getting completely overloaded at certain points of the day. I think that when one of these overloads happens, it interferes with closing the TCP Connection to the printers and stops me from establishing any new connections.
I think my next stop will be to monitor all the socket connections using netstat and also to try to check out all the network traffic with packetyzer and try and see what exactly is happening with the TCP connections when this happens again.
Then I will probably think about how I could manage keeping the TCP connection to the printers open all the time rather than opening and closing each time.
Thanks to both of you for all your help and relating your similar experiences - it's been invaluable in getting my little grey cells working in the right direction! (And has saved me from another day of and :headbang: !)
Cheers!
Sam