关于symbian通过socket发生结构体 有代码 void CTestConnectionAppUi::TCPSendReceiveL() { //define the struct which to send _LIT8(KHTTPGetRequest,"Hello"); Info *iInfo = new Info();
//open socket server sessioin RSocketServ ss; CleanupClosePushL(ss); TInt err = ss.Connect(); User::LeaveIfError(err); //Open connnection on the socket server session RConnection conn; CleanupClosePushL(conn); User::LeaveIfError(conn.Open(ss)); //start the default connection TRequestStatus status; conn.Start(status); //wait for the connection to start User::WaitForRequest(status); //Check if start succeed User::LeaveIfError(status.Int()); //open TCP socket on the started connection RSocket sock; CleanupClosePushL(sock); TInt error; error = sock.Open(ss,KAfInet,KSockStream,KProtocolInetTcp,conn); User::LeaveIfError(error); //Connection to the remote peer(221,208,196,46) TInetAddr remoteAddr(INET_ADDR(127,0,0,1), 7788); sock.Connect(remoteAddr,status); User::WaitForRequest(status); User::LeaveIfError(status.Int());
/*Now that we are connected, * exchange some data... * Make a HTTP GET request to the remote peer */ //发送描述符