Not to be a wiseacre, but the "logic" is pretty simple: when the user asks you to stop, stop; when they ask to resume, resume. Now, the implementation is another story. To help you with that, we'd need to know how this would be used, what you had so far, and what part you needed help with. Do you understand the basics of networking in Java? Is this part of a desktop application, or an online thing? The more you explain to us, the more we can help.
I'm pretty sure this doesn't belong in the "advanced Java" forum, but I'll wait until we know more before I decide which other forum we should move it to.