Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Start new Socket Sub-connection to Access Point

From Wiki
Jump to: navigation, search
Article Metadata
Created: spark55 (10 Sep 2007)
Last edited: hamishwillee (27 Jul 2012)

SIOCIFSTART and SIOCIFACTIVESTART are actual ioctl( ) calls which would start a connection or subconnection. All the socket communication calls such as connect(), read(), write(), send(), receive(), sendto(), and recvfrom() should come after calling SIOCIFSTART and SIOCIFACTIVESTART. Calls such as getsockopt(), and getsockname() that do not require any connection do not have any dependency on SIOCIFSTART and SIOCIFACTIVESTART.

The code to start a new socket connection can be seen here.

The following code shows how to start a new subconnection using an existing connection.

void NewSubconnection(char *ifname)
ifreq ifr;
int sockfd1, sockfd2;
// Name of the interface
strcpy(ifr.ifr_name, ifname);
ioctl(sockfd1,SIOCSIFNAME, &ifr);
ioctl(sockfd1, SIOCIFSTART , &ifr);
ioctl(sockfd2,SIOCSIFNAME, &ifr);
//Start subconnection using a connection created earlier
ioctl(sockfd2, SIOCIFACTIVESTART , &ifr);
//recvfrom() and sendto() operations on socket sockfd2 and sockfd1
ioctl(sockfd2, SIOCIFSTOP, &ifr); // Stop the connection
ioctl(sockfd1, SIOCIFSTOP, &ifr); // Stop the connection


This page was last modified on 27 July 2012, at 04:15.
71 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.