Re: Connecting to a socket with a GTK application
- From: Tristan Van Berkom <vantr touchtunes com>
- To: Evan Martin <martine cs washington edu>
- Cc: Maarten <maarten mercuri el ub es>, gtk-app-devel-list gnome org
- Subject: Re: Connecting to a socket with a GTK application
- Date: Fri, 07 Mar 2003 09:45:03 -0500
Yep, a struct sockaddr_in can be casted to a struct sockaddr
for general purpose api calls.
you even have a type (socklen_t) to hold the size of
a given sockaddr.
Cheers,
-Tristan
Evan Martin wrote:
On Fri, Mar 07, 2003 at 11:07:03AM +0100, Maarten wrote:
But I get this error:
Tipnose1.c: In function `client':
Tipnose1.c:45: warning: passing arg 2 of `connect' from incompatible
pointer type
[...]
struct sockaddr_in sniff;
[...]
c = connect(sock, &sniff, sizeof(sniff) );
This problem is unrelated to GTK. The second parameter to connect()
must be a sockaddr*, not a sockaddr_in*. Google for "sockets tutorial"
(or something like that) for more information.
--
Evan Martin
martine cs washington edu
http://neugierig.org
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]