[maemo-developers] Automatic connection

From: Frank Banul frank.banul at gmail.com
Date: Wed Aug 22 05:49:43 EEST 2007

I am trying to get my application to do automatic network connection
as detailed in the section on the 2.2 tutorial

My startup script is:
case `uname -m` in
        arm*) source /usr/bin/connectivity_preload.sh;;   # armel
        *) ;;                                # some other architecture

I also tried running from xterm:
source /usr/bin/connectivity_preload.sh

In either case, my call to connect returns -1.

    dest_addr.sin_family = AF_INET;          // host byte order
    dest_addr.sin_port = htons(DEST_PORT);   // short, network byte order
    dest_addr.sin_addr.s_addr = inet_addr(ip_addr);
    memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);

    if (connect(sockfd, (struct sockaddr *)&dest_addr, sizeof
dest_addr) == -1) {
      hildon_banner_show_information(GTK_WIDGET(window), NULL,
                             "connect_to_soundbridge: Unable to connect");
      return FALSE;

Am I doing something wrong? Is there another requirement that I am missing?

In the case that I start the Wifi connection, then the connect
succeeds and I can communicate with my target.


More information about the maemo-developers mailing list