summaryrefslogtreecommitdiff
path: root/docs/tutorials/Chap_2/ex01.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/Chap_2/ex01.html')
-rw-r--r--docs/tutorials/Chap_2/ex01.html106
1 files changed, 0 insertions, 106 deletions
diff --git a/docs/tutorials/Chap_2/ex01.html b/docs/tutorials/Chap_2/ex01.html
deleted file mode 100644
index 0de2788c3cf..00000000000
--- a/docs/tutorials/Chap_2/ex01.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="Author" CONTENT="Ambreen Ilyas">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; SunOS 5.5.1 sun4u) [Netscape]">
-</HEAD>
-<BODY>
-<FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT>
-<BR><FONT COLOR="#CC0000">//// This example is from the ACE Programmers
-Guide.</FONT>
-<BR><FONT COLOR="#CC0000">////&nbsp; Chapter: "IPC SAP" (Interprocess Communication
-Mechanisms in ACE).</FONT>
-<BR><FONT COLOR="#CC0000">//// For details please see the guide at</FONT>
-<BR><FONT COLOR="#CC0000">//// http://www.cs.wustl.edu/~schmidt/ACE.html</FONT>
-<BR><FONT COLOR="#CC0000">////&nbsp; AUTHOR: Umar Syyid (usyyid@hns.com)</FONT>
-<BR><FONT COLOR="#CC0000">//// and Ambreen Ilyas (ambreen@bitsmart.com)</FONT>
-<BR><FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT>
-
-<P><FONT COLOR="#FF0000">//Example 1</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/SOCK_Acceptor.h"</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/SOCK_Stream.h"</FONT>
-<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">SIZE_DATA
-18</FONT>
-<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">SIZE_BUF
-1024</FONT>
-
-<P>class Server{
-
-<P>public:
-<BR>Server (int port):
-<BR>&nbsp;server_addr_(port),peer_acceptor_(server_addr_){
-<BR>&nbsp;data_buf_= new char[SIZE_BUF];
-<BR>&nbsp;}
-
-<P><FONT COLOR="#FF0000">//Handle the connection once it has been established.</FONT>
-<BR><FONT COLOR="#FF0000">//Here the connection is handled by reading SIZE_DATA
-amount of data</FONT>
-<BR><FONT COLOR="#FF0000">//from the remote and then closing the connection</FONT>
-<BR><FONT COLOR="#FF0000">//stream down.</FONT>
-<BR>int handle_connection(){
-<BR>&nbsp;<FONT COLOR="#FF0000"> // Read data from client</FONT>
-<BR>&nbsp;if(new_stream_.recv_n (data_buf_, SIZE_DATA, 0)==-1)
-<BR>&nbsp; ACE_ERROR ((LM_ERROR, "%p\n", "Error in recv"));
-<BR>&nbsp;
-
-<P>&nbsp;ACE_DEBUG((LM_DEBUG,"Server recieved %s \n",data_buf_));
-<BR>&nbsp;
-<BR>&nbsp;<FONT COLOR="#FF0000">// Close new endpoint</FONT>
-<BR>&nbsp;if (new_stream_.close () == -1)
-<BR>&nbsp; ACE_ERROR ((LM_ERROR, "%p\n", "close"));
-<BR>&nbsp;return 0;
-<BR>}
-<BR><FONT COLOR="#FF0000">//Use the acceptor component peer_acceptor_ to
-accept the connection</FONT>
-<BR><FONT COLOR="#FF0000">//into the underlying stream new_stream_. After
-the connection has been</FONT>
-<BR><FONT COLOR="#FF0000">//established call the handle_connenction() method.</FONT>
-<BR>int accept_connections (){
-<BR>&nbsp;if (peer_acceptor_.get_local_addr (server_addr_) == -1)
-<BR>&nbsp; ACE_ERROR_RETURN ((LM_ERROR,"%p\n","Error in get_local_addr"),1);
-
-<P>&nbsp;ACE_DEBUG ((LM_DEBUG,"Starting server at port %d\n",
-<BR>&nbsp; server_addr_.get_port_number ()));
-<BR>&nbsp;
-
-<P>&nbsp;<FONT COLOR="#FF0000">// Performs the iterative server activities.</FONT>
-<BR>&nbsp;while(1){
-<BR>&nbsp; ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT);
-<BR>&nbsp; if (peer_acceptor_.accept
-<BR>&nbsp;&nbsp;&nbsp; (new_stream_, &amp;client_addr_, &amp;timeout)==
--1){
-<BR>&nbsp;&nbsp; ACE_ERROR ((LM_ERROR, "%p\n", "accept"));
-<BR>&nbsp;&nbsp; continue;
-<BR>&nbsp;&nbsp; }
-<BR>&nbsp; else
-<BR>&nbsp;&nbsp; ACE_DEBUG((LM_DEBUG,
-<BR>&nbsp;&nbsp; "Connection established with remote %s:%d\n",
-<BR>&nbsp;&nbsp; client_addr_.get_host_name(),client_addr_.get_port_number()));
-<BR>&nbsp;&nbsp; <FONT COLOR="#FF0000">//Handle the connection</FONT>
-<BR>&nbsp;&nbsp; handle_connection();
-<BR>&nbsp; }
-<BR>&nbsp;}
-<BR>&nbsp;
-<BR>&nbsp;
-
-<P>private:
-<BR>&nbsp;char *data_buf_;
-<BR>&nbsp;ACE_INET_Addr server_addr_;
-<BR>&nbsp;ACE_INET_Addr client_addr_;
-<BR>&nbsp;ACE_SOCK_Acceptor peer_acceptor_;
-<BR>&nbsp;ACE_SOCK_Stream new_stream_;
-<BR>&nbsp;ACE_HANDLE newhandle;
-<BR>};
-
-<P>int main (int argc, char *argv[]){
-<BR>&nbsp;if(argc&lt;2){
-<BR>&nbsp; ACE_ERROR((LM_ERROR,"Usage egX &lt;port_num>"));
-<BR>&nbsp; ACE_OS::exit(1);
-<BR>&nbsp; }
-<BR>&nbsp;Server server(ACE_OS::atoi(argv[1]));
-<BR>&nbsp;server.accept_connections();
-<BR>}
-
-<P>&nbsp;<A HREF="ex02.html">Next Example</A>
-</BODY>
-</HTML>