Networking Forums

Networking Forums > Computer Networking > Linux Networking > socket vs tcp

Reply
Thread Tools Display Modes

socket vs tcp

 
 
Ciur Eugen
Guest
Posts: n/a

 
      03-11-2009, 06:18 AM
Hello !

Below is an excerpt from a book:

If the reason you can’t connect to the server is that the Unix socket
file has been removed,
you can get it back simply by restarting the server. (The server will
re-create the
socket file when it comes back up.) The trick here is that because the
socket file is gone,
you can’t use it to establish a connection for telling the server to
stop.You must establish
a TCP/IP connection instead.To do this, connect to the local server by
using the
--protocol=tcp option or by specifying a host value of 127.0.0.1
rather than

I have a question : TCP connection is not using a socket ? As far as I
know whenever
you create a tcp connection there is an socket created through which
all communication
is performed. Do I miss something ? Are there two different types of
connection : socket and tcp ?
Please help me to understood.

Thank you very much !
 
Reply With Quote
 
 
 
 
Gil Hamilton
Guest
Posts: n/a

 
      03-11-2009, 11:18 AM
Ciur Eugen <(E-Mail Removed)> wrote in news:9eae2c03-951a-4013-9f49-
(E-Mail Removed):

> Below is an excerpt from a book:
>
> If the reason you can’t connect to the server is that the Unix socket
> file has been removed,
> you can get it back simply by restarting the server. (The server will
> re-create the
> socket file when it comes back up.) The trick here is that because the
> socket file is gone,
> you can’t use it to establish a connection for telling the server to
> stop.You must establish
> a TCP/IP connection instead.To do this, connect to the local server by
> using the
> --protocol=tcp option or by specifying a host value of 127.0.0.1
> rather than
>
> I have a question : TCP connection is not using a socket ? As far as I
> know whenever
> you create a tcp connection there is an socket created through which
> all communication
> is performed. Do I miss something ? Are there two different types of
> connection : socket and tcp ?
> Please help me to understood.


"Unix socket" isn't the same thing as "TCP socket".

A unix socket (also called 'unix domain socket' or 'AF_UNIX socket' or
'local socket') is a transport mechanism that only works on the local
machine. As with TCP sockets, there is a session-oriented version (like
TCP) and a datagram-style version of it (similar to UDP).

When you create the listening end of the unix socket, the kernel creates
a pseudo-file in the file system hierarchy based on a path name you
specify. The file's inode has a special bit set indicating that it's a
unix socket endpoint. In order to connect to the server, you create a
unix socket of your own and perform a connect(2) system call specifying
the path name of the pseudo-file. (See the unix(7) man page for more
detail.) If someone removes the pseudo-file from the directory (with
the rm(1) commmand for example), you will no longer be able to connect
to the server via the unix socket.

Some programs -- the X Windows server traditionally was one of these --
create a unix domain socket endpoint as well as a TCP socket endpoint.
The TCP socket endpoint doesn't have any representation in the file
system, so there is no danger of its endpoint being removed (other than
by killing the server program). I'm guessing that the book reference
you cited is referring to such a server that offers both types of
endpoints.


GH
 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      03-11-2009, 05:31 PM
"Sockets" are an interface to what lies below. A socket could
interface to local inter-process communication implementation such as
that which support "AF_UNIX" stuff, or to inter-system communication
such as TCP or UDP etc. Often folks will use something like "Unix
Socket" or "TCP Socket" as a shorthand for "a socket associated with a
Unix Domain endpoint" or "a socket associated with a TCP endpoint."
It is more convenient, but tends to obscure the relationship.

rick jones
--
the road to hell is paved with business decisions...
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
Ciur Eugen
Guest
Posts: n/a

 
      03-12-2009, 07:12 AM
On Mar 11, 8:31*pm, Rick Jones <rick.jon...@hp.com> wrote:
> "Sockets" are an interface to what lies below. *A socket could
> interface to local inter-process communication implementation such as
> that which support "AF_UNIX" stuff, or to inter-system communication
> such as TCP or UDP etc. *Often folks will use something like "Unix
> Socket" or "TCP Socket" as a shorthand for "a socket associated with a
> Unix Domain endpoint" or "a socket associated with a TCP endpoint."
> It is more convenient, but tends to obscure the relationship.
>
> rick jones
> --
> the road to hell is paved with business decisions...
> these opinions are mine, all mine; HP might not want them anyway...
> feel free to post, OR email to rick.jones2 in hp.com *but NOT BOTH...


Thank you very much Gil and Rick for very
enlightening information!
Best regards.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test socket on Master Socket not working Kevin Cowans Broadband 14 11-15-2006 09:17 PM
10038 Socket Operation on non-socket =?Utf-8?B?UkNyYWlnTGF3MUBhb2wuY29t?= Windows Networking 3 12-23-2004 03:01 AM
10038 socket operation on non-socket Bill H. Windows Networking 1 09-27-2004 03:56 AM
10038 Socket Operation on non-socket error Tim G Windows Networking 1 09-26-2004 03:04 PM
WLAN Monitor 10038 Socket operation on non-socket Bill Windows Networking 1 03-01-2004 10:34 PM



1 2 3 4 5 6 7 8 9 10 11