Details

  • Similar Issues:
    None

Description

TcpConnector includes a pool for sockets and a factory abstraction (TcpSocketFactory). The SslConnector, which subclasses TcpConnector, doesn't use these. Instead sockets are created in the message dispatcher.

Apart from general problems with code duplication and related issues, this means that the getOutputStream() method that SslConnector inherits from TcpConnector will not work (I have not tested this, but note that no SSL tests exist for that functionality).

I believe that it would be relatively simple (a few days work - I'm still on a fairly steep learning curve!) to refactor this code so that TlsSupport generates an appropriate SSL socket factory in SslConnector, setting it in the super class (TcpConnector.setSocketFactory()).

This would then mean that SSL and TCP sockets become "identical" (distinguished only by the injected factory for sockets). They could then have the same support classes and you would get streaming (etc) "for free".

I suspect there may be similar issues with HTTP/HTTPS - I haven't looked there yet. Also, this only integrates sockets for sending. It seems likely that handling sockets for receiving could also be unified in the same way, but again I haven't looked at this in detail.

I am spinning this off the email SSL work (MULE-855) because it's a major change to the SSL component and I'm not sure I am right in my arguments above (comments please!).

Activity

Hide
Ross Mason added a comment -

This makes sense. Since I already converted the other 'socket' trasports I can probably do this pretty quickly. If I don't make a move on it please feel free to pick it up

Show
Ross Mason added a comment - This makes sense. Since I already converted the other 'socket' trasports I can probably do this pretty quickly. If I don't make a move on it please feel free to pick it up
Hide
Andrew Cooke added a comment -

Ross - we discussed this in SF and I am grabbing it as agreed (IIRC). Hope you're not fixing this as you snowboard...

Show
Andrew Cooke added a comment - Ross - we discussed this in SF and I am grabbing it as agreed (IIRC). Hope you're not fixing this as you snowboard...
Hide
Andrew Cooke added a comment -

Just a heads-up that I intend to move the server socket generation into the connector too. That will make client and server sockets consistent and allow us to use the TCP message receiver as well as the dispatcher. It means changing the TCP code, but the modification is small, I think (haven't done it yet...). I may introduce a TcpServerSocketFactory (and related SslServerSocketFactory) to keep things tidy.

Show
Andrew Cooke added a comment - Just a heads-up that I intend to move the server socket generation into the connector too. That will make client and server sockets consistent and allow us to use the TCP message receiver as well as the dispatcher. It means changing the TCP code, but the modification is small, I think (haven't done it yet...). I may introduce a TcpServerSocketFactory (and related SslServerSocketFactory) to keep things tidy.
Hide
Andrew Cooke added a comment -

(May need to change fix version)

Includes general tidying of TCP, SSL and HTTP packages.

Show
Andrew Cooke added a comment - (May need to change fix version) Includes general tidying of TCP, SSL and HTTP packages.
Hide
Andrew Perepelytsya added a comment -

Andrew, let's keep it open, so we don't lose track of pending 1.4.1 changes. Close after it's in the 1.4 branch physically, that should happen after an initial 1.4 release.

Show
Andrew Perepelytsya added a comment - Andrew, let's keep it open, so we don't lose track of pending 1.4.1 changes. Close after it's in the 1.4 branch physically, that should happen after an initial 1.4 release.
Hide
Andrew Cooke added a comment -

I just realised that, given what I now understand about the process, I can assign this to you, Dirk.

Show
Andrew Cooke added a comment - I just realised that, given what I now understand about the process, I can assign this to you, Dirk.
Hide
Andrew Cooke added a comment -

Sorry Dirk, back to you (just mistakenly assigned this to me, then realised I still don't understand the release strategy).

Show
Andrew Cooke added a comment - Sorry Dirk, back to you (just mistakenly assigned this to me, then realised I still don't understand the release strategy).
Hide
Andrew Cooke added a comment -

OK, I think I can close this after all.

Show
Andrew Cooke added a comment - OK, I think I can close this after all.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: