TCP vs Sockets: A request for elucidation! (test your knowledge)
Author |
Message |
jackthechemist
|
Posted: Sun Mar 28, 2010 11:54 pm Post subject: TCP vs Sockets: A request for elucidation! (test your knowledge) |
|
|
Greetings,
So, I've studied sockets, and studied TCP, and enjoy a beginner-intermediate understanding of each. However I desperately need clarification regard some fundamental concepts. Any help would be greatly appreciated:
1) Do sockets implement TCP? When I uses a socket to send data to another computer, are the computers using TCP or is it my responsibility to implement it (ie write the program such that the methods of the sockets mimic the rules dictated by TCP) I am confused.
2) I've read most of the RFC regarding TCP. It mentions a 'user interface'. Further, it specifies various TCP 'commands'. If MSN / Pidgin is using TCP, how could I use say C / Python to send 'TCP commands' and if MSN / Pidgin is merely using sockets to do this and the OS is responsible for TCP implementation then how can i send say a TCP header (consisting of 1s and 0s) manually? I know how to manually send HTTP requests manually, how can i do this with TCP?
Before you respond, please note, I'm not a programmer, I'm a chemist (I just happen to love computers) so for my sake, try to answer accordingly! ^_^
Jack |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
DtY
![](http://compsci.ca/v3/uploads/user_avatars/8576159234be48b7a8b0e8.png)
|
Posted: Mon Mar 29, 2010 3:10 pm Post subject: RE:TCP vs Sockets: A request for elucidation! (test your knowledge) |
|
|
TCP is implemented largely in hardware (and the rest in the operating system or libraries), so you don't actually use TCP directly (unless you were doing low level hardware programming).
Sockets is a library that gives an interface to TCP (it can also do UDP, and I suppose it would be possible to make a library that would implement other low level protocols). It gives you convenience stuff like buffering and an interface that is cross platform.
I'm not sure if you can access TCP directly, you can't in a platform agnostic way, at least.
It's probably best to think of sockets like using the file functions to open a file and write to it rather than using whatever method on the operating system to write directly to the sectors on the disk. |
|
|
|
|
![](images/spacer.gif) |
jackthechemist
|
Posted: Sat Apr 03, 2010 4:55 pm Post subject: Re: TCP vs Sockets: A request for elucidation! (test your knowledge) |
|
|
Cool. Thanks for the advice. |
|
|
|
|
![](images/spacer.gif) |
peeterparker
|
Posted: Mon Apr 26, 2010 11:17 pm Post subject: RE:TCP vs Sockets: A request for elucidation! (test your knowledge) |
|
|
Excellent answer |
|
|
|
|
![](images/spacer.gif) |
|
|