[Development] [Feature Request] Websockets

Shane Kearns shane.kearns.qt at gmail.com
Wed Aug 21 00:09:52 CEST 2013


Hi,

I would also make it an addon for now.
There is one reason why it would need to go in QtNetwork, and that is to
allow upgrading a QNetworkRequest/QNetworkReply into a QWebSocket.
That would be a complex feature to implement, and isn't required to use
websockets.

I believe that a QML/javascript binding to your websocket implementation
would be possible without needing to put the code into QtNetwork. For
example, the webkit binding for QML works in this way so that QtDeclarative
doesn't have a dependency on QtWebkit.

When the implementation is mature, and websocket becomes important enough
to consider it as core functionality required to implement a networked
application, then we should move it into QtNetwork.

Currently your implementation passes some conformance tests, and is proven
in one application. These are both good milestones.
I'd support you using Qt project infrastructure (e.g. JIRA and codereview)
for your addon, if this is something you want. The Qt serial port addon is
an example of an addon that does this already.

>From my initial code review, the main tasks to do are:
1. refactor into public header files (the API), and private header files
(implementation classes)
2. build as a library, rather than a .pri file to include for static
linkage with the application.
3. addon metadata files

Step 1 gives us a well defined API, which we can review for completeness
and cleanness.
It also makes binary compatible updates possible.
Steps 2 and 3 will make it easier for users of the addon to use it from
their projects like any other Qt library.

Some of the questions I'd be asking myself in the API review are:
Could I implement the javascript websocket API on top of this?
Is the API intuitive for somebody who knows the js API, and Qt C++?
Is the API easy to use for the common cases?
Does the API expose enough to make the complex cases possible?
How consistent is the API with similar APIs in Qt?

On 15 August 2013 01:20, Kurt Pattyn <pattyn.kurt at gmail.com> wrote:

> Hi Peter,
>
>
>
> On 14 Aug 2013, at 18:32, Peter Hartmann <phartmann at blackberry.com> wrote:
>
> > Hello,
> >
> > thanks for the effort!
> >
> > On 08/14/2013 05:54 PM, Kurt Pattyn wrote:
> >> (...)
> >> 1. Is there any interest in adding this to Qt?
> >
> > yes, please :)
> >
> >> 2. If so, should this be added to QtNetwork or is a add-on preferred?
> >
> > My first impression is that it is not extensively used by big sites
> (yet), is it? So I would rather go for an add-on for now, but I am of
> course open to be convinced otherwise.
> >
> I don't have figures about the popularity of websockets, so I cannot tell.
> Going for an add-on seems acceptable, given the large install base of Qt.
>
> > Also apparently the API is rather big (5 classes with lots of methods),
> so adding it as an add-on (first) might be something to consider as well,
> in case we want to change the API even after the review or so...
>
> Well, the API for the end-user consists in fact only of 2 classes: one for
> client applications (WebSocket class, comparable to QTcpSocket), and one
> for server applications (WebSocketServer class). The APIs are modelled
> after QAbstractSocket resp. QTcpServer, so the learning curve should be
> minimal.
> However, you have a point that it might be better to add it to the
> add-ons, in order to get a 'feeling' if it fits the main library or not (I
> suppose customers will tell).
>
> BTW: I only received 2 responses to this mail: does that mean, this is not
> important enough to be considered for inclusion? I am a bit confused about
> how to proceed. Do I just dump the code into gitorious, and wait for
> reactions? Do I leave it where it is? (BTW, Shane already reviewed some of
> the code, which is awesome; thanks Shane).
>
> Kurt
>
> >
> > Peter
> >
> >
> >>
> >> Best regards,
> >>
> >> Kurt Pattyn
> >> _______________________________________________
> >> Development mailing list
> >> Development at qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/development
> >
> >
> > ---------------------------------------------------------------------
> > This transmission (including any attachments) may contain confidential
> information, privileged material (including material protected by the
> solicitor-client or other applicable privileges), or constitute non-public
> information. Any use of this information by anyone other than the intended
> recipient is prohibited. If you have received this transmission in error,
> please immediately reply to the sender and delete this information from
> your system. Use, dissemination, distribution, or reproduction of this
> transmission by unintended recipients is not authorized and may be unlawful.
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130820/e550439d/attachment.html>


More information about the Development mailing list