Problems using bind() in KDevelop
Simon Ejsing
simon at esoft.dk
Mon Sep 2 12:34:47 BST 2002
What am I doing wrong here, I've used sockets like this in plain C, but
apparently it doesn't compile using KDevelop 2.1.3 (Qt 3.0.5)? (And the
reason I don't use QSocket, is that it keeps crashing my application with
wierd error messages, so I consider it unreliable...)
<code snip from the cpp file of a KDE mini application>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "socktest.h"
Socktest::Socktest(QWidget *parent, const char *name) : QWidget(parent, name)
{
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_port = htons(0);
addr.sin_addr = INADDR_ANY; // This is the line where the error occurs....
sock_fd = socket(AF_INET,SOCK_STREAM,0);
bind(sock_fd,(struct sockaddr *) addr,sizeof(addr));
}
<snip end>
Error message is:
socktest.cpp:31: no match for `in_addr & = in_addr_t'
--
/Sharky
-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«
More information about the KDevelop
mailing list