Open and close socket per request

Version 1
    This document was generated from CDN thread

    Created by: JUNG DRINKWATER on 10-07-2009 06:57:54 PM
    Hello David,
     
    Can you tell me if the following steps are valid?
     
    open socket
    send AXL request
    get AXL response 
    send another AXL request
    get AXL response
    .
    .
    .
    close socket
     
    Thanks,
     
    Jung

    Subject: RE: Open and close socket per request
    Replied by: David Staudt on 11-07-2009 12:28:24 AM
    AXL will always close the socket after sending the Response.  There is no way to specify/configure alternatve behaviour.

    Subject: RE: Open and close socket per request
    Replied by: Paul Wilkinson on 13-07-2009 02:16:29 AM
    Hi,
     
    I specify HTTP keepalives in my HttpWebRequest object (I am coding in C#) and this seems to work - I get a number of AXL request/responses executing before the HTTPS session is closed and a new one opened.
     
    Aside from the KeepAlive property, you also need to set UnsafeAuthenticatedConnectionSharing to true and ProtocolVersion to HttpVersion.Version11.
     
    Paul

    Subject: RE: Open and close socket per request
    Replied by: David Staudt on 13-07-2009 04:28:56 AM
    Interesting...so you are able to send several requests on the same TCP connection?  Then the connection is closed by AXL?  Is this after a number of requests or a time limit..?
     
    I'd like to confirm this behaviour with engineering to ensure it's something you can rely on.  My understanding is that separate connections for each request is the intended behaviour.  What version of UCM are you testing with?

    Subject: RE: Open and close socket per request
    Replied by: Paul Wilkinson on 13-07-2009 09:59:22 AM
    Hi David,
     
    I have definately seen this with 6.1.2.1106-1 and possibly other versions.
     
    I have attached a packet capture - although the data is encrypted I think that you can see by the volume of data transferred that this covers more than one request before the source port changes. (Change the extension from .txt to .cap)
    I noticed that the developer guide includes the following:
    Override the GetWebRequest method to use HTTP 1.0 due to an error between TOMCAT/AXIS
    and the .NET HTTP 1.1 Web Service request mechanism.



    But I have found it works very well with 1.1 and improves performance significantly.  The only thing I found that I had to do other than the properties I mentioned in my previous post was to set the authenticate header manually rather than using the credentials property of the .Net HttpWebRequest.
     
    Paul

    Subject: RE: Open and close socket per request
    Replied by: JUNG DRINKWATER on 13-07-2009 08:26:26 PM
    We've tested one open/close with multiple requests and responses here with the 4.2.3 and 5.1.3 releases. It seems working fine. We are only testing for the list requests not update requests. (Read only) It seems much faster to pull information from the CUCM server. We are wondering what risk we are taking by using one open/close for multiple reqests and responses.
     
    Thanks,
     
    Jung

    Subject: RE: Open and close socket per request
    Replied by: David Staudt on 15-07-2009 09:47:29 PM
    AXL sends the response back via HTTP 1.1, which by default uses keep alive connections.  The developer guide has some sample responses which show the header "Connection: close" present, which would mean AXL is NOT keeping the connection alive, however in testing against my CM701 setup, this header is missing.
     
    Based on observation, then, persistent connections should work (if they don't, there is a defect either in not returning the header or implementing persistent connections.)  I understand per HTTP 1.1 the connection can be closed at any time when needed by client or server, however.  I would expect/hope AXL would eventually clean up such connections after some time limit, if they were idle.

    Subject: RE: Open and close socket per request
    Replied by: JUNG DRINKWATER on 16-07-2009 05:14:46 PM
    We will go ahead do the one open/close solution.
    Thanks for the help!
    Jung