Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
titakalpesh
Posts: 203
Registered: ‎07-30-2009
My Device: Bold(9780),Curve(8520)
My Carrier: Vodafone
Accepted Solution

How to create socket connection under proxy?

Hi everyone,

 

I'm trying to create socket connection under proxy connection,it's not working and I set the proxy setting in MDS and I'm able to create http connection but it gives me the error  "Connection refused" when I try socket connection,so please any body have any idea please help me to do this.

 

Thanks In advanced

Tita

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to create socket connection under proxy?

[ Edited ]

Is the connection being refused by MDS or by your proxy?

Please use plain text.
Developer
titakalpesh
Posts: 203
Registered: ‎07-30-2009
My Device: Bold(9780),Curve(8520)
My Carrier: Vodafone

Re: How to create socket connection under proxy?

i don't know about it but when i create connection it throws the exception net.rim.device.cldc.io.ippp.SocketBaseIOException:   Connection refused: exception but  when i add device side true it throw "java.io.IOException: Peer refused the connection".

 

Thanks

Tita

Please use plain text.
Developer
rishabh_jain04
Posts: 95
Registered: ‎01-25-2010
My Device: 9530

Re: How to create socket connection under proxy?

 

@peter_strange, How we know the connection is refused by MDS or by proxy? I am facing same problem.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to create socket connection under proxy?

[ Edited ]

Good question.

 

Presuming you are testing on the simulator, then the MDS logs, which are displayed in the 'black window' you see when you start the MDS simulator, may provide useful information.  Alternatively, the proxy may have logs that tell you when it has refused a connection and why.  That is where I would look.

 

Apologies, I have never been in the position you are in, so this suggestion is not based on experience.  Just that is where I would look next. 

 

Edit you might find a TCP tracing tool, like WireShark, useful in this too. 

Please use plain text.
Developer
titakalpesh
Posts: 203
Registered: ‎07-30-2009
My Device: Bold(9780),Curve(8520)
My Carrier: Vodafone

Re: How to create socket connection under proxy?

Hi peter,

 

I'm not getting any thing in log file so I attached it with this post so please check it and help me to do this.

 

Thanks

Tita

Please use plain text.
Developer
rishabh_jain04
Posts: 95
Registered: ‎01-25-2010
My Device: 9530

Re: How to create socket connection under proxy?

[ Edited ]

thank you peter_strange for suggestion,

 

   Yes you are right i am testing application in simulator(8900). i have tried to understand MDS log file but i am not getting what actually it display.

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to create socket connection under proxy?

OK, like I said, I'm not great at these sorts of things.

 

From the log this seems to be the key section:

<2010-09-08 15:17:06.832 IST>:[73]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = R
eceiving, TAG = -305760326, DEVICEPIN = 2100000a, VERSION = 16, CONNECTIONID = 4
64273007, SEQUENCE = 0, TYPE = CONNECTION-REQUEST, CONNECTIONHANDLER = , PROTOCO
L = TCP, PARAMETERS = [talk.google.com:5222], SIZE = 100>
<2010-09-08 15:17:06.832 IST>:[74]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = C
reatedReceivingQueue, DEVICEPIN:CONNECTIONID = 2100000a:464273007, ReceivingQueu
eSize = 1>
<2010-09-08 15:17:06.832 IST>:[75]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = S
tartExecuting, TAG = -305760326, DEVICEPIN = 2100000a, VERSION = 16, CONNECTIONI
D = 464273007, SEQUENCE = 0, TYPE = CONNECTION-REQUEST, CONNECTIONHANDLER = , PR
OTOCOL = TCP, PARAMETERS = [talk.google.com:5222], SIZE = 100>
<2010-09-08 15:17:06.832 IST>:[76]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = E
ndExecuting, TAG = -305760326, DEVICEPIN = 2100000a, VERSION = 16, CONNECTIONID
= 464273007, SEQUENCE = 0, TYPE = CONNECTION-REQUEST, CONNECTIONHANDLER = , PROT
OCOL = TCP, PARAMETERS = [talk.google.com:5222], SIZE = 100>
<2010-09-08 15:17:06.832 IST>:[77]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Av
ailable threads in DefaultJobPool = 9 running JobRunner: DefaultJobRunner-1>
<2010-09-08 15:17:06.848 IST>:[78]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, TCP Threa
d: DefaultJobRunner-1 started>
<2010-09-08 15:17:06.863 IST>:[79]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = R
eceiving, TAG = -305760325, DEVICEPIN = 2100000a, VERSION = 16, CONNECTIONID = 4
64273007, SEQUENCE = 1, TYPE = DATA, SIZE = 164>
<2010-09-08 15:17:06.863 IST>:[80]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = S
tartExecuting, TAG = -305760325, DEVICEPIN = 2100000a, VERSION = 16, CONNECTIONI
D = 464273007, SEQUENCE = 1, TYPE = DATA, SIZE = 164>
<2010-09-08 15:17:06.863 IST>:[81]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = E
ndExecuting, TAG = -305760325, DEVICEPIN = 2100000a, VERSION = 16, CONNECTIONID
= 464273007, SEQUENCE = 1, TYPE = DATA, SIZE = 164>
<2010-09-08 15:17:07.770 IST>:[82]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Fi
nished JobRunner: DefaultJobRunner-1, available threads in DefaultJobPool = 10,
time spent = 922ms>
<2010-09-08 15:17:07.785 IST>:[83]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, Connectio
n refused: connect
>

 

Anyway, this looks to me like the MDS attempted to establish communicatino and was refused.  So you need to talk to whoever manages your proxy and find out why.

 

As a test, and I don't know how good this test will be, you can try the following:

 

1) Make sure you can connect to talk.google.com from your browser, by starting your Browser and typing in the URL

talk.google.com

 

2) Start a command line (black screen) session.

3) On that session type in

telnet /?

you should get a response that indicates the possible parameters that you can use with telnet.

4) type in

telnet talk.coogle.com 5222

this will put a request in to port 5222 of google talk.  I will be interested to see what comes back.

 

But you are beyond what I know what to do, this could be all completely wrong. 

Please use plain text.
Developer
rishabh_jain04
Posts: 95
Registered: ‎01-25-2010
My Device: 9530

Re: How to create socket connection under proxy?

[ Edited ]

thanks peter_strange for being continue to help us,

 

  I have talked to my server manager and they are going to provide me by pass connection. may be it solved issue...

 

the answer of your questions are:

 

1.  I am able to login with my gmail account in desktop's browser but when i tried to login in simulator's browser it comes with this error "The selected server returned an error when attempting to fulfill your request".

 

2. out put of command line of "telnet/?" command

 

 telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]]
 -a      Attempt automatic logon. Same as -l option except uses
         the currently logged on user's name.
 -e      Escape character to enter telnet client prompt.
 -f      File name for client side logging
 -l      Specifies the user name to log in with on the remote system.
         Requires that the remote system support the TELNET ENVIRON option.
 -t      Specifies terminal type.
         Supported term types are vt100, vt52, ansi and vtnt only.
 host    Specifies the hostname or IP address of the remote computer
         to connect to.
 port    Specifies a port number or service name.

 

out put of  "telnet talk.coogle.com 5222"

"Connection to talk.google.com... could not open connection to the host, on port 23: connect failed"

Please use plain text.
Developer
rishabh_jain04
Posts: 95
Registered: ‎01-25-2010
My Device: 9530

Re: How to create socket connection under proxy?

[ Edited ]

hi ,

 

thank you peter_strange for your support. kudo for your.:smileyhappy:

i got the solution  in my old thread. please see for answer http//www.answer

Please use plain text.