You cannot simply switch between ports without 'running down' the cache.

If you have work from port-A in the cache and switch to port-B then port-B will reject the port-A work.

To switch from 1 port to another you should run down the cache first.

WUCacheSize in the client config file will set how many workunits the client will download at a time.

When you want to empty the cache, edit the cache size to 1.
Stop and restart the client so that it registers the new setting.
Keep tabs on the number of lines in the file workfile.txt.
When it gets down to 2 lines, remove the '-- ' comment mark from in front of the 'once=1'
then stop and restart the client and it will complete the last workunit and shut down.
Then re-insert the '--' comment mark in front of the 'once=1' (or it will only do 1 wu when you restart)
Then change your port number and restart the client.

This will avoid errors and ensure that you get all the credit for your hard work.