Skip to main content

Posts

Showing posts from March, 2014

Blackberry 10 cascades - client side socket programming

Blackberry 10 has full support for BSD Sockets API . All the routines one can expect from BSD Sockets are available in Blackberry 10. But cascades make socket programming much easier. In this post we will discuss client side socket programming in Blackberry 10 using cascades . You can study about BSD Sockets API support in Blackberry 10 here . Before starting to use Cascades socket API you have to add this line to your .pro file QT+= network Cascades API provide a high level class QTcpSocket  which makes writing client side socket code very easy. Include following files in your cpp file #include <QtNetwork/QAbstractSocket> #include <QtNetwork/QTcpSocket> Any client side socket app performs following operations 1) Connect to server 2) Send / Receive data 3) Close connection Connecting to server QTcpSocket provides a function connectToHost which takes IP Address/Hostname (QString) , port (quint16) and OpenMode (default value is ReadWrite) as parameters.