Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 21:05, 26 October 2007.

Iniciar uma nova conexão via sockets a um ponto de acesso

From Forum Nokia Wiki

Original: Start new Socket Connection to Access Point

Um vez que a lista de pontos de acesso disponíveis for obtida, o seguinte código mostra como iniciar uma nova conexão usando os pontos de acesso disponíveis.

void ConnectToAP(char *ifname)
{
	ifreq ifr;
	int sockfd;
 
	// Nome da interface
	strcpy(ifr.ifr_name, ifname);
	
	sockfd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);	
	ioctl(sockfd,SIOCSIFNAME, &ifr);
	ioctl(sockfd, SIOCIFSTART , &ifr);	
	
 
	// Operações recvfrom() e sendto() no socket sockfd
 
	ioctl(sockfd, SIOCIFSTOP, &ifr);
 
	close(sockfd);
	return ret;
}

No código acima, SIOCSIFNAME API é usada para selecionar o ponto de acesso.


Links relacionados

Related Discussions
Thread Thread Starter Forum Replies Last Post
creating sockets in MIDP... supanana Mobile Java General 2 2003-03-19 11:10
Data from a 3650 to a PC? speedsix Mobile Java General 1 2004-03-24 14:48
Nokia 6820 MIDP1.0 + Sockets? nuce Mobile Java Networking & Messaging & Security 3 2004-04-01 06:53
two quetions-appuifw.Icon and socket llapplecn Python 2 2005-07-08 09:42
Socket example problem on real N7650 chinazou305 Symbian Networking & Messaging 3 2003-06-06 16:32
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX