unisock_8h-source.html

来自「一个功能强大的内存数据库源代码,c++编写,有详细的注释」· HTML 代码 · 共 84 行

HTML
84
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>unisock.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.15 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center><hr><h1>unisock.h</h1><div class="fragment"><pre>00001 <font class="comment">//-&lt; UNISOCK.H &gt;-----------------------------------------------------*--------*</font>00002 <font class="comment">// FastDB                    Version 1.0         (c) 1997  GARRET    *     ?  *</font>00003 <font class="comment">// (Main Memory Database Management System)                          *   /\|  *</font>00004 <font class="comment">//                                                                   *  /  \  *</font>00005 <font class="comment">//                          Created:      7-Jan-97    K.A. Knizhnik  * / [] \ *</font>00006 <font class="comment">//                          Last update:  7-Jan-97    K.A. Knizhnik  * GARRET *</font>00007 <font class="comment">//-------------------------------------------------------------------*--------*</font>00008 <font class="comment">// Unix socket </font>00009 <font class="comment">//-------------------------------------------------------------------*--------*</font>00010 00011 <font class="preprocessor">#ifndef __UNISOCK_H__</font>00012 <font class="preprocessor"></font><font class="preprocessor">#define __UNISOCK_H__</font>00013 <font class="preprocessor"></font>00014 <font class="preprocessor">#include "sockio.h"</font>00015 00016 <font class="keyword">class </font>unix_socket : <font class="keyword">public</font> socket_t { 00017   <font class="keyword">protected</font>: 00018     <font class="keywordtype">int</font>           fd; 00019     <font class="keywordtype">int</font>           errcode;     <font class="comment">// error code of last failed operation </font>00020     <font class="keywordtype">char</font>*         address;     <font class="comment">// host address</font>00021     socket_domain domain;      <font class="comment">// Unix domain or INET socket</font>00022     <font class="keywordtype">bool</font>          create_file; <font class="comment">// Unix domain sockets use files for connection</font>00023 00024     <font class="keyword">enum</font> error_codes { 00025         ok = 0,00026         not_opened = -1,00027         bad_address = -2,00028         connection_failed = -3,00029         broken_pipe = -4, 00030         invalid_access_mode = -500031     };00032 00033   <font class="keyword">public</font>: 00034     <font class="comment">//</font>00035     <font class="comment">// Directory for Unix Domain socket files. This directory should be </font>00036     <font class="comment">// either empty or be terminated with "/". Dafault value is "/tmp/"</font>00037     <font class="comment">//</font>00038     <font class="keyword">static</font> <font class="keywordtype">char</font>* unix_socket_dir; 00039 00040     <font class="keywordtype">bool</font>      open(<font class="keywordtype">int</font> listen_queue_size);00041     <font class="keywordtype">bool</font>      connect(<font class="keywordtype">int</font> max_attempts, time_t timeout);00042 00043     <font class="keywordtype">int</font>       read(<font class="keywordtype">void</font>* buf, size_t min_size, size_t max_size, 00044                    time_t timeout);00045     <font class="keywordtype">bool</font>      write(<font class="keywordtype">void</font> <font class="keyword">const</font>* buf, size_t size);00046 00047     <font class="keywordtype">bool</font>      is_ok(); 00048     <font class="keywordtype">bool</font>      shutdown();00049     <font class="keywordtype">bool</font>      close();00050     <font class="keywordtype">char</font>*     get_peer_name();00051     <font class="keywordtype">void</font>      get_error_text(<font class="keywordtype">char</font>* buf, size_t buf_size);00052 00053     socket_t* accept();00054     <font class="keywordtype">bool</font>      cancel_accept();00055     00056     <font class="keywordtype">int</font> get_handle();00057 00058     unix_socket(<font class="keyword">const</font> <font class="keywordtype">char</font>* address, socket_domain domain); 00059     unix_socket(<font class="keywordtype">int</font> new_fd);00060 00061     ~unix_socket();00062 };00063 00064 <font class="preprocessor">#endif</font>00065 <font class="preprocessor"></font>00066 00067 00068 00069 </pre></div><hr><address align="right"><small>Generated on Fri Nov 15 21:06:29 2002 for FastDB by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.15 </small></address></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?