Skip to content

Commit

Permalink
Auto commit on 2014/06/25-10:56
Browse files Browse the repository at this point in the history
  • Loading branch information
lotabout committed Jun 25, 2014
1 parent f3cac77 commit f9c35ad
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 20 deletions.
69 changes: 50 additions & 19 deletions Unix_Network_Programming_v2.html
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>UNIX Network Programming Vol.2 Notes</title>
<!-- 2014-06-24 -->
<!-- 2014-06-25 -->
<meta charset="utf-8">
<meta name="generator" content="Org-mode">
<link rel="Stylesheet" type="text/css" href="assets/css/style.css"/>
Expand Down Expand Up @@ -76,24 +76,10 @@ <h1 class="title">UNIX Network Programming Vol.2 Notes</h1>
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">Chap01: Introduction</a>
<ul>
<li><a href="#sec-1-1">Introduction</a></li>
<li><a href="#sec-1-2">Sharing Information Between Processes and Threads</a></li>
<li><a href="#sec-1-3">Persistence of IPC Object</a></li>
</ul>
</li>
<li><a href="#sec-2">Posix IPC</a>
<ul>
<li><a href="#sec-2-1">Introduction</a></li>
</ul>
</li>
<li><a href="#sec-3">System V IPC</a>
<ul>
<li><a href="#sec-3-1">key_t Keys and ftok Function</a></li>
<li><a href="#sec-3-2">ipc_perm Structure</a></li>
</ul>
</li>
<li><a href="#sec-1">Chap01: Introduction</a></li>
<li><a href="#sec-2">Posix IPC</a></li>
<li><a href="#sec-3">System V IPC</a></li>
<li><a href="#sec-4">Pipes and FIFOs</a></li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -262,6 +248,51 @@ <h3 id="sec-3-2">ipc_perm Structure</h3>
</div>
</div>
</div>

<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4">Pipes and FIFOs</h2>
<div class="outline-text-2" id="text-4">
</div><div id="outline-container-sec-4-1" class="outline-3">
<h3 id="sec-4-1">Introduction</h3>
<div class="outline-text-3" id="text-4-1">
<p>
The fundamental limitation of pipe is that they have NO name.
</p>
</div>
</div>

<div id="outline-container-sec-4-2" class="outline-3">
<h3 id="sec-4-2">Full Duplex Pipe</h3>
<div class="outline-text-3" id="text-4-2">
<p>
It depends on the system's support. Check first if you wants to
make use of it.
</p>
</div>
</div>

<div id="outline-container-sec-4-3" class="outline-3">
<h3 id="sec-4-3">FIFO</h3>
<div class="outline-text-3" id="text-4-3">
<ol class="org-ol">
<li>when calling <code>mkfifo</code> to create FIFO, it will create a new fifo or
return <code>EEXIST</code> if the named FIFO already exists.
</li>
<li>FIFO should be open by calling <code>open</code> system call.
</li>
<li>When reading from FIFO, it will block the process. So be careful
not to block both the server and the client. (reorder the calling
of <code>read</code> and <code>write</code>).
</li>
<li>Call <code>unlink</code> to remove FIFO from the filesystem. Note that kernel
keeps a reference count of the number of open descriptors that
refer to the pipe or FIFO. Thus, when calling <code>unlink</code>, it will not
affect open descriptors that had previously opened the pathname.
</li>
</ol>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<a href="#" class="back-to-top">Back to Top</a>
Expand Down
23 changes: 23 additions & 0 deletions Unix_Network_Programming_v2.org
@@ -1,4 +1,5 @@
#+TITLE: UNIX Network Programming Vol.2 Notes
#+OPTIONS: toc:1

* Chap01: Introduction

Expand Down Expand Up @@ -75,3 +76,25 @@ they agree on the =pathname= and =id=.
** ipc_perm Structure
It is used by the kernel to maintain the information for each IPC
object, similar to the information it maintains for files.

* Pipes and FIFOs

** Introduction
The fundamental limitation of pipe is that they have NO name.

** Full Duplex Pipe
It depends on the system's support. Check first if you wants to
make use of it.

** FIFO

1. when calling =mkfifo= to create FIFO, it will create a new fifo or
return =EEXIST= if the named FIFO already exists.
2. FIFO should be open by calling =open= system call.
3. When reading from FIFO, it will block the process. So be careful
not to block both the server and the client. (reorder the calling
of =read= and =write=).
4. Call =unlink= to remove FIFO from the filesystem. Note that kernel
keeps a reference count of the number of open descriptors that
refer to the pipe or FIFO. Thus, when calling =unlink=, it will not
affect open descriptors that had previously opened the pathname.
31 changes: 30 additions & 1 deletion Unix_Network_Programming_v2.org.html
Expand Up @@ -34,6 +34,11 @@
/* org-list-dt */
font-weight: bold;
}
.org-meta-line {
/* org-meta-line */
font-weight: bold;
font-style: italic;
}
.org-verbatim {
}
.underline {
Expand All @@ -56,7 +61,8 @@
<body>
<pre>
<span class="org-document-info-keyword"><span class="hl-line">#+title:</span></span><span class="hl-line"> </span><span class="org-document-title"><span class="hl-line">UNIX Network Programming Vol.2 Notes
</span></span>
</span></span><span class="org-meta-line">#+OPTIONS: toc:1</span>

<span class="org-level-1">* Chap01: Introduction</span>

<span class="org-level-2">** Introduction</span>
Expand Down Expand Up @@ -132,6 +138,29 @@
<span class="org-level-2">** ipc_perm Structure</span>
It is used by the kernel to maintain the information for each IPC
object, similar to the information it maintains for files.

<span class="org-level-1">* Pipes and FIFOs</span>

<span class="org-level-2">** Introduction</span>
The fundamental limitation of pipe is that they have NO name.

<span class="org-level-2">** Full Duplex Pipe</span>
It depends on the system's support. Check first if you wants to
make use of it.

<span class="org-level-2">** FIFO</span>

1. when calling <span class="org-verbatim">=mkfifo=</span> to create FIFO, it will create a new fifo or
return <span class="org-verbatim">=EEXIST=</span> if the named FIFO already exists.
2. FIFO should be open by calling <span class="org-verbatim">=open=</span> system call.
3. When reading from FIFO, it will block the process. So be careful
not to block both the server and the client. (reorder the calling
of <span class="org-verbatim">=read=</span> and <span class="org-verbatim">=write=</span>).
4. Call <span class="org-verbatim">=unlink=</span> to remove FIFO from the filesystem. Note that kernel
keeps a reference count of the number of open descriptors that
refer to the pipe or FIFO. Thus, when calling <span class="org-verbatim">=unlink=</span>, it will not
affect open descriptors that had previously opened the pathname.

</pre>
</body>
</html>

0 comments on commit f9c35ad

Please sign in to comment.