c++ - a write() to tun/tap interface returns "invalid argument" -
i have created , attached tap interface. can read interface no problem. trying write fails reporting "invalid argument". code follows :
int tapinterface::write(char *buf, int n) { int nwrite; if((nwrite=::write(this->my_tap_fd, buf, n))<0) { qdebug("writing data") ; perror("error:"); exit(1); } return nwrite; } .... .... qbytearray txdata("hello"); write(txdata.data(), txdata.length());
any help?
Comments
Post a Comment