SOCK_DGRAM and TCP

  • Follow


====== TCP (Stream Sockets) ======

----------------------------------
Sequence of calls for server is:

socket(AF_INET, SOCK_STREAM, 0)
bind()
listen()
accept()
while()
{
   recv()/send();
}
close()

----------------------------------
Sequence of calls for client is:

socket(AF_INET, SOCK_STREAM, 0)
connect()
while()
{
  send()/recv{}
}
close()

==================================


What will happen if we will put
socket(AF_INET, SOCK_DGRAM, 0)
instead of
socket(AF_INET, SOCK_STREAM, 0)
in sequences above?


-- 
 Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn





0
Reply Alex 12/28/2005 7:26:22 PM


0 Replies
248 Views

(page loaded in 0.026 seconds)

Similiar Articles:







7/25/2012 4:36:38 AM


Reply: