Are sockets faster than http on Blackberry?

I am writing a Blackberry application that was originally implemented in standard J2ME. Network connections were made using Connector.open("socket://...:80/...") instead of http://

Now I have implemented a connection using both methods, and it seems that several times, the socket method is more responsive, and sometimes it does not work at all. Is there a significant difference between the two? Basically, what I'm trying to achieve is responsiveness from the connection to get a smooth progress bar.

+4
source share
4 answers

Implementing Blackberry http and https provides more options for connecting to the target server than socket , and, of course, implement all the HTTP protocol materials for you. I have not tested them, but it makes sense to say that direct TCP through socket will be faster in some cases, especially if what listens on port 80 is not an HTTP server (there is no protocol overhead)

In the past, I had difficulties with different network providers, some of which needed deviceside=true others deviceside=false , and there was no real way to find out until the first support call for this network appeared.

Basically, what I'm trying to achieve is responsiveness from the connection to get a smooth progress bar.

Forgive my statement, but the “smooth progress indicator” - “gilding of a lily” - is pleasant to have and watch, but not critical for the application function, reliability or reliability. Go with more reliable and reduce the size of the code - probably http in this case.

+5
source

Since both work over the network, I don’t think you can guarantee a smooth progress bar. You may be more likely to do this if you remind a person to stay in one place so that you have the possibility of a serial connection;)

A socket connection has less overhead than HTTP. In fact, HTTP connections are made through a socket connection. You can use reduced socket connection overheads to make them look more responsive, but you will probably have more work than with HTTP. The API is lower level, so coding is more complex.

+2
source

One difference between the socket and the HTTP connection on BlackBerry is that HTTP connections can be transparently routed through HTTP proxies for BES and BIS connections.

+1
source

In theory, sockets will be faster, but then you are responsible for managing the overhead of running your own protocol (depending on complexity). Although sockets are lighter, I found that HTTP and everything that comes with it significantly reduces headaches.

0
source

All Articles