Design Pattern for Server Emulator

Posted by adisembiring on Stack Overflow See other posts from Stack Overflow or by adisembiring
Published on 2010-03-19T04:30:23Z Indexed on 2010/03/19 5:01 UTC
Read the original article Hit count: 288

Filed under:
|
|

I wanna build server socket emulator, but I want implement some design pattern there. I will described my case study that I have simplified like these:

My Server Socket will always listen client socket. While some request message come from the client socket, the server emulator will response the client through the socket.

the response is response code. '00' will describe request message processed successfully, and another response code expect '00' will describe there are some error while processing the message request.

IN the server there are some UI, this UI contain check response parameter such as. response code timeout interval

  1. While the server want to response the client message, the response code taken from input parameter response form UI
  2. check the timeout interval, it will create sleep thread and the interval taken from timeout interval input from UI.

I have implement the function, but I create it in one class. I feel it so sucks. Can you suggest me what class / interface that I must create to refactor my code.

© Stack Overflow or respective owner

Related posts about java

Related posts about design