mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
76 lines
5.4 KiB
HTML
76 lines
5.4 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
|
|
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF">
|
|
<CENTER>
|
|
<img src="princeton.gif"> <img src="ccrma.gif"> <img src="mcgill.gif"><P>
|
|
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="information.html">Information</a> <a class="qindex" href="classes.html">Classes</a> <a class="qindex" href="download.html">Download</a> <a class="qindex" href="usage.html">Usage</a> <a class="qindex" href="maillist.html">Mail List</a> <a class="qindex" href="system.html">Requirements</a> <a class="qindex" href="links.html">Links</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.3.4 -->
|
|
<h1>Socket.h</h1><div class="fragment"><pre>00001 <span class="comment">/***************************************************/</span>
|
|
00019 <span class="comment">/***************************************************/</span>
|
|
00020
|
|
00021 <span class="preprocessor">#if !defined(__SOCKET_H)</span>
|
|
00022 <span class="preprocessor"></span><span class="preprocessor">#define __SOCKET_H</span>
|
|
00023 <span class="preprocessor"></span>
|
|
00024 <span class="preprocessor">#include "Stk.h"</span>
|
|
00025
|
|
<a name="l00026"></a><a class="code" href="classSocket.html">00026</a> <span class="keyword">class </span><a class="code" href="classSocket.html">Socket</a> : <span class="keyword">public</span> <a class="code" href="classStk.html">Stk</a>
|
|
00027 {
|
|
00028 <span class="keyword">public</span>:
|
|
00030
|
|
00033 <a class="code" href="classSocket.html#a0">Socket</a>( <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a6">port</a> = 2006 );
|
|
00034
|
|
00036
|
|
00039 <a class="code" href="classSocket.html#a0">Socket</a>( <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a6">port</a>, <span class="keyword">const</span> <span class="keywordtype">char</span> *hostname );
|
|
00040
|
|
00042 <a class="code" href="classSocket.html#a2">~Socket</a>();
|
|
00043
|
|
00045
|
|
00053 <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a3">connect</a>( <span class="keywordtype">int</span> port, <span class="keyword">const</span> <span class="keywordtype">char</span> *hostname = <span class="stringliteral">"localhost"</span> );
|
|
00054
|
|
00056 <span class="keywordtype">void</span> <a class="code" href="classSocket.html#a4">close</a>( <span class="keywordtype">void</span> );
|
|
00057
|
|
00059 <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a5">socket</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span>;
|
|
00060
|
|
00062 <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a6">port</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span>;
|
|
00063
|
|
00065
|
|
00071 <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a7">accept</a>( <span class="keywordtype">void</span> );
|
|
00072
|
|
00074 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classSocket.html#e0">setBlocking</a>( <span class="keywordtype">int</span> socket, <span class="keywordtype">bool</span> enable );
|
|
00075
|
|
00077 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classSocket.html#a4">close</a>( <span class="keywordtype">int</span> socket );
|
|
00078
|
|
00080 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classSocket.html#e2">isValid</a>( <span class="keywordtype">int</span> socket );
|
|
00081
|
|
00083 <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a8">writeBuffer</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *buffer, <span class="keywordtype">long</span> bufferSize, <span class="keywordtype">int</span> flags = 0);
|
|
00084
|
|
00086 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a8">writeBuffer</a>(<span class="keywordtype">int</span> socket, <span class="keyword">const</span> <span class="keywordtype">void</span> *buffer, <span class="keywordtype">long</span> bufferSize, <span class="keywordtype">int</span> flags );
|
|
00087
|
|
00089 <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a9">readBuffer</a>(<span class="keywordtype">void</span> *buffer, <span class="keywordtype">long</span> bufferSize, <span class="keywordtype">int</span> flags = 0);
|
|
00090
|
|
00092 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classSocket.html#a9">readBuffer</a>(<span class="keywordtype">int</span> socket, <span class="keywordtype">void</span> *buffer, <span class="keywordtype">long</span> bufferSize, <span class="keywordtype">int</span> flags );
|
|
00093
|
|
00094 <span class="keyword">protected</span>:
|
|
00095
|
|
00096 <span class="keywordtype">char</span> msg[256];
|
|
00097 <span class="keywordtype">int</span> soket;
|
|
00098 <span class="keywordtype">int</span> poort;
|
|
00099 <span class="keywordtype">bool</span> server;
|
|
00100
|
|
00101 };
|
|
00102
|
|
00103 <span class="preprocessor">#endif // defined(__SOCKET_H)</span>
|
|
</pre></div><HR>
|
|
|
|
<table>
|
|
<tr><td><A HREF="http://www-ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
|
<tr><td>©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|