Kishore
Kishore

Reputation: 942

HTTP over UDT in Android

I've a customized UDT protocol which is running fine on Android. Now I want to implement HTTP request and response (runs over TCP by default) to run over my UDT from my application.

  1. Is this possible?

  2. Is there any in-built mechanism in Android for this?

  3. Do I've to modify the existing HTTP stack of android to get the job done.

There are many protocols which does this. But I'm not sure about Android.

Upvotes: 1

Views: 821

Answers (1)

Malt
Malt

Reputation: 30335

  1. Is it possible?

Let's look at RFC 2616 (the HTTP/1.1 standard):

HTTP communication usually takes place over TCP/IP connections. The default port is TCP 80 [19], but other ports can be used. This does not preclude HTTP from being implemented on top of any other protocol on the Internet, or on other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used;

The RFC clearly states that HTTP's only requirement is a reliable transport protocol. Since UDT is reliable, yes, it is possible.

  1. Is there any in-built mechanism in Android for this?

I'm not an expert on Android, but I highly doubt it. The point of most HTTP abstractions is to hide the nitty gritty protocol details from the developer and let you focus on the application logic instead of worrying about headers and sockets. Since HTTP over anything that's not TCP is fairly unorthodox, I really doubt that there are existing HTTP abstractions that allow you to use non-standard transport protocols. So to the best of my knowledge, the answer is no (if someone knows otherwise, correct me if I'm wrong).

  1. Do I've to modify the existing HTTP stack of android to get the job done.

Since my answer to (2) is no, my answer to (3) is yes. You'll probably have to modify the existing HTTP tools, or write your own. You might want to look for implementations of HTTP over UDP (that might be a somewhat more popular use case) or use a tool like netty for implementing your own custom protocol stack.

Upvotes: 2

Related Questions