09-23-2010 06:59 AM
Hi everybody i try to make connect with ServerSocketConnection, when it run into line socket.acceptAndOpen().have nothing to returns, just stuck on that
ServerSocketConnection server = (ServerSocketConnection)Connector.open("socket://:
HttpServerConnection conn = (HttpServerConnection) socket.acceptAndOpen();
Does anyone know how to solve it please help!
Thanks in advance
09-23-2010 11:40 AM
acceptAndOpen(); is used for listening connections, in other words, to let other people connect to your BlackBerry. It will return when someone tries to connect.
Is that what you were trying to do?
If you were trying to create a standard socket connection to a server, then I recommend the socketdemo sample.
09-23-2010 11:36 PM
thank you for you answer. i 'm trying to do with push application( i read in pushdemo application). When i try to access this link
i got return 200 result, after that i want to open port
ServerSocketConnection socket = (ServerSocketConnection) Connector.open( "http://:myport");
so how can i get successful with acceptAndOpen()
09-24-2010 04:16 AM
Sorry never look at BIS push myself. However as a learning exercise, have you looked at the httppushdemo included in your SDK. As far as I know, it effectively does the same client processing as when you use BIS push, but you can control it from your PC. A good place to start. I would recommend that you give it a go.
09-24-2010 09:57 PM
thank you for you answer, i have look at httppushdemo i follow step by step in readme.txt file. but i cant receive anything on screen. i try with Rim option i got result
java.io.IOException: Server returned HTTP response code: 400 for URL: http://localhost:8080/push?DESTINATION=2100000A&PORT=100&REQUESTUR
and try with Pap nothing happen.
i try to debug it stuck at link stream = _notify.acceptAndOpen(); also
09-29-2010 07:50 AM
Is the MDS-CS Simulator running when you attempt the push? Are you able to browse with the BlackBerry Browser? Do you see activity in the MDS-CS Simulator window when you attempt the push?
It sounds like you may have another web server running on your PC using port 8080. That means the MDS-CS Simulator is unable to listen on that port and accept your push connection. The 400 response would be coming from the other web server. You can change the port the MDS-CS Simulator is listening on by modifying the WebServer.listen.port parameter in the rimpublic.property file. If you are using Eclipse, this is found in the following directory: