T
T
tschin2016-10-04 17:26:12
Qt
tschin, 2016-10-04 17:26:12

How to connect to tcp server via raw sockets in Linux using Qt?

Hello! You need to write a client to communicate with a tcp server. I use raw sockets, because the standard qt's sockets did not want to start on the computer where the program will be used.
The whole project is written in Qt, only networking is in raw sockets.
I use this page as an example of working with raw sockets :
everything would be fine, but Qt swears at this line:

//Connect to remote server
        if (  connect(socket_desc , (struct sockaddr *)&server , sizeof(server)) < 0)

Qt uses connect to connect slots and signals... The
question is how to connect in Linux via raw sockets to a tcp server using Qt?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sergey, 2016-10-04
@tschin

if (  ::connect(socket_desc , (struct sockaddr *)&server , sizeof(server)) < 0)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question