BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-19-2009, 12:37 AM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8310
PIN: N/A
Carrier: mobilink
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default strange behavior on TCP connection

Please Login to Remove!

I'm trying to implement FTP protocol on blackberry 8310 device. Everything is working perfectly fine on emulator but strange behavior is being observed on actual hardware. Remember i'm trying to do FTP communication in passive mode

I've opened control socket with following code:

(StreamConnection)Connector.open(controlURL+";devi ceside=true;Connector.READ_WRITE");

Everything worked fine and been able login to FTP server and do exchange of control commands.

Then i open the data port for file transfer with following code:

(StreamConnection)Connector.open(dataURL+";devices ide=true;Connector.READ_WRITE");

But the connection is never established and a timeout exception is thrown after few seconds.

everything is working fine on emualtor . I also have one other TCP connection opened in parallel to FTP control connection and it is working fine too.

Please help me to diagnose the issue. There is no issue with FTP protocol implementation but why this strange behavior is happening with FTP data connection . I also tried to establish data connection at port less than 1024 but that also didn't work.

I'm running a network sniffer at FTP server but no SYN packet at data port is coming from device.

thanks,
shahzad
Offline  
Old 04-19-2009, 06:31 AM   #2 (permalink)
BlackBerry Master
 
dankarlinski's Avatar
 
Join Date: May 2007
Model: 1
Carrier: 1
Posts: 3,391
Post Thanks: 1
Thanked 2 Times in 2 Posts
Default

Wirelessly posted (My Bold)

You way that TCP works fine with other programs?

If so, then it is def. Something with this ftp.

Check the sniffer again for all of the packets sent and recicved with the ftp. The berry MAY be waiting for a response. Pacjet from the site/server and is not getting it. That may be why it is timing out. However, that doesn't explain why it works on the EMU. Just a thought


I'm assuming you are on a BIS. If you are on BES, your problem may be there
Offline  
Old 04-19-2009, 07:20 AM   #3 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8310
PIN: N/A
Carrier: mobilink
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your reply. Yup im on BIS but their is no suspected activity when observed through sniffer.

Infact when data connection is opened , there must be 3 way TCP handshake (Syn, SynAck and ack packets) but there are no such packets on FTP server . It means data connection request is being lost in NetWork .

But at the same time FTP control channel and another TCP connection for some other purpose is working perfectly fine.
Offline  
Old 04-19-2009, 08:09 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I don't see any WAP or APN info in your connection string, after "deviceside=true".

A WAP connection requires gateway info.

A TCP Direct connection requries APN info.

Also, your ending quote is in the wrong place in your connection string - should be:

(StreamConnection)Connector.open(dataURL+";devices ide=true",Connector.READ_WRITE);
Offline  
Old 04-20-2009, 04:40 AM   #5 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8310
PIN: N/A
Carrier: mobilink
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yup i've corrected the error in open method of Connector but nothing worked.

If apn information is set in setting>advanced options>TCP then one does not need to set in URL.

There must be some other reason. Most probably provider is doing something with data

Last edited by shazlhr : 04-20-2009 at 05:52 AM.
Offline  
Old 04-20-2009, 11:19 AM   #6 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8310
PIN: N/A
Carrier: mobilink
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just pin down the issue.

Actually either provider or RIM is filtering the traffic. Everything goes smooth in FTP control connection . But when FTP server is asked to switch into passive mode, it replies the client with FTP data port .But either RIM or service provider is keeping an eye on traffic and as soon as data port is sent , they log it and if request for connection establishment is sent on that data port , they simply block it.

I tested it by making TCP connection at random port after passive mode command is sent to FTP server and it worked perfectly alright. But if i tried to make TCP connection at port received in response to passive mode command, it was simply blocked.

Please confirm me that who is responsible for data filtering , either service provider(Mobilink) or RIM itself.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.