What is the difference between the socket and pipe?

Showing Answers 1 - 8 of 8 Answers

Guest

  • Mar 3rd, 2006
 

socket and Pipe are all togeather different thinks

socket -It is part of OSI LAYER MODEL.  in Osi model communication between diferrent layer takes places through sockets.say apllication layer provide services trough certain sockets to  presentation layer  and presentation layer uses certain other socket to communicate with upper application layer.

 socket are used in SECURE SOCKET LAYER NETWORKS

 pipes- it is realated to  processing of  a process in

cpu , pipes are segments of a process in execution.

generaly process are divided into distinct segments which are linearly dependent.ie output of first segment become input for next segment and so on

generally by processing multiple pipes simultaneously ,we can imporve productivity.ie we can run differnt pipe segment simultaneosuly, by keeping in mind ,that they dont indulge  in wainting for each other.

  Was this answer useful?  Yes

Guest

  • Mar 3rd, 2006
 

socket and Pipe are all togeather different thinks

socket -It is part of OSI LAYER MODEL.  in Osi model communication between diferrent layer takes places through sockets.say apllication layer provide services trough certain sockets to  presentation layer  and presentation layer uses certain other socket to communicate with upper application layer.

 socket are used in SECURE SOCKET LAYER NETWORKS

 pipes- it is realated to  processing of  a process in

cpu , pipes are segments of a process in execution.

generaly process are divided into distinct segments which are linearly dependent.ie output of first segment become input for next segment and so on

generally by processing multiple pipes simultaneously ,we can imporve productivity.ie we can run differnt pipe segment simultaneosuly, by keeping in mind ,that they dont indulge  in wainting for each other.

                        ABHISHEK TRIPATHI

                        M.C.A 4TH SEM

                         M.L.S.U, UDAIPUR ,RAJ

                EMAIL - abhipounty@yahoo.co.in

  Was this answer useful?  Yes

Anand

  • Mar 18th, 2006
 

Socket and Pipes both are the modes of inter process communicationin Linux or UNIX like systems.Socket is used to communicate between network processes..and kernel mediates for that..like for your internet explorer a socket is created and your Device driver(of Modem)communicates to socket for communicationpipes is another mode of bi directonal communication between orocesses

  Was this answer useful?  Yes

pravin

  • Jul 6th, 2006
 

Socket: it is logical connection for communication of application or two different system. Socket is given named. Then it is called Port. OS have near about 65536 sockets. (i.e 2 pair, 1 for TCP & other for UDP).  Socket from 0 to 1024 are reserved for OS used. While we can use socket above this in our program, say for socket programming in JAva. Socket that are used by client to communicate with Server are ephermal port (short lived) & are released after their session are over.  This name socket (port) have wellknown with port number, ex. Telnet Server work onTCP port no. 23, TFTP on UDP port 69.

Pipe: pipe is use for connection link. This is used for sending and reciving information within OS or application. Output/ Input through pipe can be buffered or cached. ( in processor also there are pipe U & V pipes)

  Was this answer useful?  Yes

vigrem

  • Jul 26th, 2007
 

Pipe is a linear array of bytes, as is a file, but it is used solely as an I/O stream, and it is unidirectional. It also has no name, and thus cannot be opened with open. Instead, it is created by the pipe system call, which returns two descriptors, one of which accepts input that is sent to the other descriptor reliably, without duplication, and in order. The system also supports a named pipe or FIFO. A FIFO has properties identical to a pipe, except that it appears in the filesystem; thus, it can be opened using the open system call. Two processes that wish to communicate each open the FIFO: One opens it for reading, the other for writing.             A socket is a transient object that is used for interprocess communication; it exists only as long as some process holds a descriptor referring to it. A socket is created by the socket system call, which returns a descriptor for it. There are different kinds of sockets that support various communication semantics, such as reliable delivery of data, preservation of message ordering, and preservation of message boundaries.

  Was this answer useful?  Yes

Pipe is a special file. Two types of pipes are:
unnamed pipes
named pipes (FIFO)
1) Pipe is used for IPC - (Inter Process Communication), whereas socket is used for IPC and also for communication of process in network.
2) pipe supports destructive reading (once if you read it vanishes), Socket does not.

ayat khalid

  • Feb 16th, 2015
 

Sockets allow communication between two different processes on the same or different machines. To be more precise, its a way to talk to other computers using standard Unix file descriptors. In Unix, every I/O action is done by writing or reading a file descriptor. A file descriptor is just an integer associated with an open file and it can be a network connection, a text file, a terminal, or something else.
To a programmer, a socket looks and behaves much like a low-level file descriptor. This is because commands such as read() and write() work with sockets in the same way they do with files and pipes.
Sockets were first introduced in 2.1BSD and subsequently refined into their current form with 4.2BSD. The sockets feature is now available with most current UNIX system releases.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions