WEB开发网
开发学院手机开发Symbian 开发 Symbian socket 网络编程方法 阅读

Symbian socket 网络编程方法

 2010-03-18 20:59:00 来源:WEB开发网   
核心提示:iSocket.Connect(iAddress, iStatus);User::WaitForRequest(iStatus);if (iStatus.Int() ==KErrNone){iStatus = KRequestPending;iSocket.Write(writeBuf,iStatus);User::W

iSocket.Connect(iAddress, iStatus);

User::WaitForRequest(iStatus);

if (iStatus.Int() ==KErrNone)

{

iStatus = KRequestPending;

iSocket.Write(writeBuf,iStatus);

User::WaitForRequest(iStatus);

if (iStatus.Int() ==KErrNone)

{

TSockXfrLength iDummyLength;

TInt recvSize = 0;

for(;;)

{

iStatus = KRequestPending;

iSocket.RecvOneOrMore(recvBuf, 0, iStatus, iDummyLength);

User::WaitForRequest(iStatus);

if (iStatus.Int()==KErrNone)

{

recvSize += recvBuf.Length();

if(iBuffer==NULL)

iBuffer = HBufC8::NewL(recvSize);

else

iBuffer = iBuffer->ReAlloc(recvSize);

iBuffer->Des().Append(recvBuf);

}

else

{

break;

}

}

}

}

iSocket.Close();

}

iSocketServ.Close();

}

iNif.Close();

return iBuffer;

}

此段代码只是对socket用法

上一页  13 14 15 16 17 18 

Tags:Symbian socket 网络编程

编辑录入:coldstar [复制链接] [打 印]
赞助商链接