1

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.

1 Answer 1

2
  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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for the suggestion. Can you please help me to get started with netty to make HTTP over UDT. I've downloaded the netty source and set up maven environment on eclipse.
@Kishore 1. Sorry, but I can't. While I know of netty, I haven't actually used it beyond some hello-world kind of stuff. 2. You might want to make the implementation of such a protocol over netty into a a separate question, one that's tagged with the "netty" tag.
Thank you. I've already posted the question stackoverflow.com/questions/26409881/…
Is there any framework similar to Netty which supports Obj-C (Ios)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.