qt - QUdpSocket setSockOpt -


i have old code, use flags in socket:

unsigned char str_optval [8] = {0xfc, 0x08, 0xff, 0x33, 0xcc, 0xff, 0xaa, 0x0}; res=setsockopt(sid,sol_ip,ip_options, (char*)&str_optval,sizeof(str_optval)); 

how can change place use qudpsocket? can't find analog setsockopt in qudpclass. qabstractsocket provide setsocketoption, allow 4 variants flags (enum). need in linux version, if native func it's ok.

http://qt-project.org/doc/qt-5.0/qtnetwork/qabstractsocket.html#socketoption-enum

socket options not limited udp datagrams. having said that, qt has limited number of options can set on socket. common options being able set. rest platform specific stuff.

aside: hardcoded literals, in quoted code, big no-no. non-portable , nightmare maintain. whatever do, @ least change literals names defined in standard headers.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -