Hi all!

During my refactoring battles I've faced with a task to replace a custom socket 
read\write framework with commons-httpclient.
That would really simplify a code and [probably] bring a better perfomance.

One of the use cases is the following chain of actions:

1) write some command to socket
2) do something on server-side (for instance, press the button 'I got your request, 
man!')
3) read the response from socket

Now I stuck porting this to HttpClient, because I'm wondering how should I tell 
HttpClient to wait for user action.
It probably means that Client should keep listening the socket after writing some data 
to it? How to do this?

The code looks like this :

        HttpClient client = new HttpClient();
        HostConfiguration hc = new HostConfiguration();
        hc.setHost("localhost", 1010);
        client.setHostConfiguration(hc);
        PostMethod post = new PostMethod();
        post.setRequestBody(requestBody);
        client.executeMethod(post);

Thanks,
Alexey

========
 
Alexey Buistov, 
Software Engineer, 
Miratech Ltd. 
41 Nauki Ave, 
03028 Kiev, Ukraine, 
tel:   +38 044 206 4090 ext number
        +38 044 206 4099
fax:  +38 044 206 4091 
ICQ: 83154650
http://www.miratech.ua
mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to