close

 

RSocketServ gSocketServer;

RConnection gConnection;

RSocket fd;

TRequestStatus status = KRequestPending;

TInetAddr recvAddr;

TInt retval;

TUint ip_host_older;

 

gSocketServer.Connect(); 

gConnection.Open(gSocketServer);

gConnection.Start();

/* Opening a socket */

retval = fd.Open(gSocketServer, KAfInet, KSockStream, KProtocolInetTcp,gConnection);

if(retval != KErrNone)

{

User::Leave( KErrGeneral);

}

 

/* Connecting a socket */

TInetAddr servAddr(INET_ADDR(66,249,89,99),80);

fd.Connect(servAddr,status);

User::WaitForRequest(status);

 

TInetAddr myaddr;

fd.LocalName(myaddr);

ip_host_older = myaddr.Address();//Address return unsigned int long

fd.Close();

 

arrow
arrow
    全站熱搜

    NatPixnet 發表在 痞客邦 留言(0) 人氣()