Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am working on a script which can send data to a remote server computer and I am wondering which is better to achieve this functionality, the high level functionality provided by HTTP or just raw sockets. It would be ideal if an answer is followed by a cogent reason why one should be picked over the other. This is an educative/real world use scenario which will involve point to point transmission between work stations over the wider internet and accuracy is paramount.

share|improve this question
1  
"Better" in what respect? For what purpose? Under what circumstances of data volume, connectivity and so on? Without a lot more context there is simply no way to answer this question. – glenatron Jan 21 at 17:48
which is more ideal for sending say up to a gig of data from one client to another client/server. – cobie Jan 21 at 17:49
1  
It's not an either-or. You can't use HTTP without using sockets. Is your question really "should I use HTTP or should I implement a proprietary protocol on top of TCP"? – Peter Taylor Jan 21 at 17:49
2  
Are you going to send it from a mobile device? Across the internet? Over a LAN? Do you care more about speed of transmission or accuracy? Have you looked at using other transmission technologies for this job? Are you likely to only ever send between one client and one server or many of either? – glenatron Jan 21 at 17:52
2  
What metric are you using to justify the approach here? Scalability, maintainability, flexibility, or something else? IOW, what makes A better than B as an "ideal" or "better" in a quantifiable way? There are more than a few facets here to consider as well as how powerful is each client as there could be security concerns about what is sent that could add another dimension here. – JB King Jan 21 at 18:00
show 3 more comments

closed as not a real question by Martijn Pieters, glenatron, Glenn Nelson, GlenH7, Oleksi Jan 21 at 19:33

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

If your goal is "educative", you should absolutely use raw sockets. HTTP is just too easy to do in any modern language, including Python, to be of any educational value. But TCP connections as exposed by the socket interface are complicated and the experience working with them will serve you in good stead for years to come.

share|improve this answer
+1 working with them will serve you in good stead for years to come – Guy Coder Jan 21 at 19:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.