📄 socket_8h-source.html
字号:
<!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>socket.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> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </center>
<hr><h1>socket.h</h1><div class="fragment"><pre>00001 <font class="comment">/*************************************************************************</font>
00002 <font class="comment"> * *</font>
00003 <font class="comment"> * This program is free software; you can redistribute it and/or modify *</font>
00004 <font class="comment"> * it under the terms of the GNU General Public License as published by *</font>
00005 <font class="comment"> * the Free Software Foundation; either version 2 of the License, or *</font>
00006 <font class="comment"> * (at your option) any later version. *</font>
00007 <font class="comment"> * *</font>
00008 <font class="comment"> *************************************************************************/</font>
00009
00010 <font class="preprocessor">#ifndef _SOCKET_H__</font>
00011 <font class="preprocessor"></font><font class="preprocessor">#define _SOCKET_H__</font>
00012 <font class="preprocessor"></font>
00013 <font class="preprocessor">#include "global.h"</font>
00014 <font class="preprocessor">#include "exception.h"</font>
00015 <font class="preprocessor">#include "logger.h"</font>
00016 <font class="preprocessor">#include "i18n.h"</font>
00017 <font class="preprocessor">#include <unistd.h></font>
00018 <font class="preprocessor">#include <arpa/inet.h></font>
00019 <font class="preprocessor">#include <netdb.h></font>
00020 <font class="preprocessor">#include <sys/socket.h></font>
00021 <font class="preprocessor">#include <sys/time.h></font>
00022 <font class="preprocessor">#include <netinet/in.h></font>
00023 <font class="preprocessor">#include <errno.h></font>
00024 <font class="preprocessor">#include <string></font>
00025
00026 <font class="keyword">using</font> <font class="keyword">namespace </font>std;
00027
<a name="l00037"></a><a class="code" href="classSocket.html">00037</a> <font class="keyword">class </font><a class="code" href="classSocket.html">Socket</a> : <font class="keyword">public</font> <a class="code" href="classLogger.html">Logger</a>
00038 {
00039 <font class="keyword">public</font>:
00045 <a class="code" href="classSocket.html#a0">Socket</a> (<font class="keyword">const</font> string &<a class="code" href="classSocket.html#n0">host</a>);
00046
00053 <a class="code" href="classSocket.html#a0">Socket</a> (<font class="keyword">const</font> string &<a class="code" href="classSocket.html#n0">host</a>, <font class="keywordtype">int</font> fd);
00054
00058 <font class="keyword">virtual</font> <a class="code" href="classSocket.html#a2">~Socket</a> ();
00059
00060 <font class="keyword">protected</font>:
00061
<a name="l00065"></a><a class="code" href="classSocket.html#n0">00065</a> string <a class="code" href="classSocket.html#n0">host</a>;
00066
<a name="l00070"></a><a class="code" href="classSocket.html#n1">00070</a> <font class="keywordtype">int</font> <a class="code" href="classSocket.html#n1">sockfd</a>;
00071
00072 <font class="keyword">public</font>:
00076 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classSocket.html#a3">connect</a> () = 0;
00077
00084 string <a class="code" href="classSocket.html#a4">localhost</a> ();
00085
00095 string <a class="code" href="classSocket.html#a5">readSocket</a> ();
00096
00107 <font class="keywordtype">void</font> <a class="code" href="classSocket.html#a6">writeSocket</a> (<font class="keyword">const</font> string &data);
00108 };
00109
00110 <font class="preprocessor">#endif</font>
00111 <font class="preprocessor"></font>
</pre></div><hr><address align="right"><small>Generated on Tue Jan 28 17:09:58 2003 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -