Start new Socket Connection to Access Point
Article Metadata
Once you get the available access points list, the following code shows how to start a new connection using available access points.
void ConnectToAP(char *ifname)
{
ifreq ifr;
int sockfd;
// Name of the interface
strcpy(ifr.ifr_name, ifname);
sockfd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
ioctl(sockfd,SIOCSIFNAME, &ifr);
ioctl(sockfd, SIOCIFSTART , &ifr);
// recvfrom() and sendto() operations on socket sockfd
ioctl(sockfd, SIOCIFSTOP, &ifr);
close(sockfd);
return ret;
}
In the above code,SIOCSIFNAME API is used to select the access point.


30 Sep
2009
Article demonstrates the function of how to Start_new_Socket_Connection_to_Access_Point from the connection. This function is very constructive. Article shows the use of sys/socket.h header file. Article also shows file descriptor “sockfd” from the system.It’s a very good way too become skilled at the programming. Adding image may advance the article. It’s a common thing for all online or internet application. As its a common, but it also a very grand thing in mobile world. Linking this article with " C_Sockets:_connect_method " etc. is a good improvement.
The code doesn't work with new OpenC SDK & S60v3 MR SDK