Qt-interest Archive, July 2007
TCP server from MFC to Qt: no newConnection() signal?
Message 1 in thread
Dear community,
We've developed an application designed to exchange data with our embedded
system. Data is transfered using the TCP protocol: workstation runs the
server and the embedded system is a client.
We've ported our application from MFC (windows socket v2) to Qt v4.3.0. But,
the server doesn't see its client anymore. I mean that our QTcpServer
instance doesn't receive any newConnection() signal.
Here are the API we used in our MFC version:
WinSock2.h
API used by the server to get connected to the client:
#if INCL_WINSOCK_API_PROTOTYPES
WINSOCK_API_LINKAGE
int
WSAAPI
connect(
IN SOCKET s,
IN const struct sockaddr FAR * name,
IN int namelen
);
#endif /* INCL_WINSOCK_API_PROTOTYPES */
API used by the server to receive data from the client:
#if INCL_WINSOCK_API_PROTOTYPES
WINSOCK_API_LINKAGE
int
WSAAPI
recv(
IN SOCKET s,
OUT char FAR * buf,
IN int len,
IN int flags
);
#endif /* INCL_WINSOCK_API_PROTOTYPES */
Does anyone can help by telling us why the connect function doesn't make the
QTcpServer instance receive an newConnection() signal?
Thanks,
Christophe
--
[ signature omitted ]
Message 2 in thread
Christophe Bismuth wrote:
> Dear community,
>
> We've developed an application designed to exchange data with our embedded
> system. Data is transfered using the TCP protocol: workstation runs the
> server and the embedded system is a client.
>
> We've ported our application from MFC (windows socket v2) to Qt v4.3.0. But,
> the server doesn't see its client anymore. I mean that our QTcpServer
> instance doesn't receive any newConnection() signal.
You are not very clear, in the above, about what the EXACT connection
esablishment process is, or exactly what your "server" and "client" are.
How is the connection initiated? What steps do you expect to happen as
it is initiated? A little more detail would be nice.
I very strongly recommend you start by watching what actually happens on
the network with a protocol analyzer. Wireshark from
http://wireshark.org is a fantastic and free option. If that doesn't
give you some idea what's wrong, read up a bit on TCP/IP's connection
process. If you don't notice something you misunderstood there, post
again with useful "works" and "doesn't work" source code excerpts that
show the process involved in setting up a connection.
--
[ signature omitted ]
Message 3 in thread
Thak you Craig for your response :o)
In fact our embedded system is running a TCP server, specs were wrong... I
just had to create a QTcpSocket to get connected to it...
Thank you,
Christophe
"Craig Ringer" <craig@xxxxxxxxxxxxxxxxxxxxx> a écrit dans le message de
news: 46A0EEDB.1010202@xxxxxxxxxxxxxxxxxxxxxxxx
> Christophe Bismuth wrote:
>> Dear community,
>>
>> We've developed an application designed to exchange data with our
>> embedded
>> system. Data is transfered using the TCP protocol: workstation runs the
>> server and the embedded system is a client.
>>
>> We've ported our application from MFC (windows socket v2) to Qt v4.3.0.
>> But,
>> the server doesn't see its client anymore. I mean that our QTcpServer
>> instance doesn't receive any newConnection() signal.
>
> You are not very clear, in the above, about what the EXACT connection
> esablishment process is, or exactly what your "server" and "client" are.
> How is the connection initiated? What steps do you expect to happen as
> it is initiated? A little more detail would be nice.
>
> I very strongly recommend you start by watching what actually happens on
> the network with a protocol analyzer. Wireshark from
> http://wireshark.org is a fantastic and free option. If that doesn't
> give you some idea what's wrong, read up a bit on TCP/IP's connection
> process. If you don't notice something you misunderstood there, post
> again with useful "works" and "doesn't work" source code excerpts that
> show the process involved in setting up a connection.
>
> --
> Craig Ringer
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]