Android: QTcpSocket issue
I'm facing an issue with QTcpSocket on Android.
My app is really simple, it does nothing but creating a QTcpSocket, connect the stateChanged signal to a lambda function and then bind it to a port.
int main( int argc, char* argv )
QGuiApplication app( argc, argv)
( QAbstractSocket::SocketState state )
qDebug() << "State changed:" << state;
if( ! socket.bind(48484) )
qDebug() << "Could not bind to port 48484";
int ret = app.exec();
I am using Qt 5.3 for iOS and OSX while it is Qt5.3.1 for Android.
On iOS and OSX i get the notification that the socket is in BoundState while for Android i get BoundState but right after it i get ClosingState then UnconnectedSate
If I run this "example":http://en.wikipedia.org/wiki/Berkeley_sockets of server/client it seems to work.
Does anyone ever had this issue ?
Did you set the "Network-Access-Rights" to your application? I think that needs to be done in some XML-file?
Indeed I have those permissions :
@ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
Whent the socket state is ClosingState or UnconnectedState the socket error is "Transport endpoint is not connected"