×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    2

    FTP problem: works on emulator, but fails on device

    Hi,
    I am on an Univesity project that is a software that communicates through wifi connection with an FTP Server (FileZilla Server) running on my desktop computer. The program runs perfectly on emulator, but on the phone release compilation the application starts on the phone, but disconnects from wireless as soon as it starts, the server receives the message requesting a connection, but can’t return the answer as the connection already broke down.
    When trying to debug with TRK, after downloading the application to the handset, carbide shows a message informing that it couldn’t be launched because of some missing libraries.
    I already have the capabilities for network control and network services. It works fine in the emulator. Any ideas about this behavior? Could it be that my cert key it’s not “capable” of signing these 2 capabilities?
    I’m using Nokia 5800.


    Code:
    void CFtpHandler::sendConnect(RSocket *sock, TRequestStatus status, TUint8 *cleanupCount){
    RBuf8 response;
    	TSockXfrLength len;
    
    	TBuf8<5> cmd;
    	cmd.Append(_L("CONN")); //store the command sent
    	// Open socket server session	
    	CleanupClosePushL(ss);
    	(*cleanupCount)++;
    	User::LeaveIfError(ss.Connect());
    	// Open connection on the socket server session
    	CleanupClosePushL(conn);
    	(*cleanupCount)++; //counts the objects inserted on cleanup stack
    	
    	// Start the default connection
    	User::LeaveIfError(conn.Open(ss));	
    	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
    	User::LeaveIfError(
    sock->Open(ss, KAfInet, KSockStream, KProtocolInetTcp, conn));
    		
    	// connect to the remote ftp server.
    	TInetAddr remoteAddr(INET_ADDR(192, 168, 1, 180), 21);
    	sock->Connect(remoteAddr, status);	
    		
    	response.CreateL(512);
    	response.CleanupClosePushL();	
    	sock.RecvOneOrMore(response,0,status,len);		
    	User::WaitForRequest(status);		
    	User::LeaveIfError(status.Int());
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: FTP problem: works on emulator, but fails on device

    Do you have the proper certificate for using NetworkControl? Besides that you do not need it in fact, consider removing. NetworkServices is enough, and it can be used with any kind of signing, including self-signed.
    RecvOneOrMore attempts to complete as soon as it can, but as its name indicates, it is going to receive at least one byte. So you may want to check that response, most likely it contains some part of the expected response.
    Otherwise your code leaks everything it can. And passing TRequestStatus by value is also questionable.

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    2

    Re: FTP problem: works on emulator, but fails on device

    Thanks for the tips wizard_hu_.
    It turns out my problem was temporization. As I was using assynchronous functions, I forgot to put some wait for request after them.
    So, it worked on emulator because of breakpoints and things like that which slows down the application. And on device the time was more strict, in a device release version it didn't work.

Similar Threads

  1. Replies: 1
    Last Post: 2009-02-16, 09:24
  2. Device Connectivity Tool fails to connect to Debug Agent
    By valichid in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2009-01-14, 02:29
  3. RDA device selection problem
    By serg3d in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-10-26, 18:05
  4. Little discussion over FTP problem
    By aficianado_001 in forum Symbian
    Replies: 2
    Last Post: 2006-03-08, 05:17
  5. Replies: 1
    Last Post: 2002-05-16, 19:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×