summaryrefslogtreecommitdiff
path: root/docs/tutorials/Chap_2/ex02.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/Chap_2/ex02.html')
-rw-r--r--docs/tutorials/Chap_2/ex02.html95
1 files changed, 0 insertions, 95 deletions
diff --git a/docs/tutorials/Chap_2/ex02.html b/docs/tutorials/Chap_2/ex02.html
deleted file mode 100644
index 69891f26f1e..00000000000
--- a/docs/tutorials/Chap_2/ex02.html
+++ /dev/null
@@ -1,95 +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]">
- <TITLE>Example 2</TITLE>
-</HEAD>
-<BODY>
-<FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT>
-<BR><FONT COLOR="#CC0000">//// This example is from the ACE&nbsp;Programmers
-Guide.</FONT>
-<BR><FONT COLOR="#CC0000">//// &nbsp;Chapter:&nbsp;"IPC&nbsp;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:&nbsp;Umar Syyid (usyyid@hns.com)</FONT>
-<BR><FONT COLOR="#CC0000">//// and Ambreen Ilyas (ambreen@bitsmart.com)</FONT>
-<BR><FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT><FONT COLOR="#FF0000"></FONT>
-
-<P><FONT COLOR="#FF0000">//</FONT><FONT COLOR="#CC0000">Example 2</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/SOCK_Connector.h"</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/INET_Addr.h"</FONT>
-<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">SIZE_BUF
-128</FONT>
-<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">NO_ITERATIONS
-5</FONT>
-
-<P>class Client{
-<BR>public:
-<BR>Client(char *hostname, int port):remote_addr_(hostname){
-<BR>&nbsp;remote_addr_.set_port_number(port);
-<BR>&nbsp;data_buf_=new char[SIZE_BUF];
-<BR>&nbsp;}
-
-<P><FONT COLOR="#FF0000">//Uses a connector component connector_ to connect
-to a remote machine</FONT>
-<BR><FONT COLOR="#FF0000">//and pass the connection into a stream component
-client_stream_</FONT>
-<BR>int connect_to_server(){
-<BR>&nbsp; <FONT COLOR="#FF0000">// Initiate blocking connection with server.</FONT>
-<BR>&nbsp; ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting connect to %s:%d\n",
-<BR>&nbsp;&nbsp;&nbsp; remote_addr_.get_host_name(),remote_addr_.get_port_number()));
-<BR>&nbsp; if (connector_.connect (client_stream_, remote_addr_) == -1)
-<BR>&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) %p\n","connection
-failed"),-1);
-<BR>&nbsp; else
-<BR>&nbsp;&nbsp;&nbsp; ACE_DEBUG ((LM_DEBUG,"(%P|%t) connected to %s\n",
-<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; remote_addr_.get_host_name ()));
-<BR>&nbsp; return 0;
-<BR>&nbsp; }
-
-<P><FONT COLOR="#FF0000">//Uses a stream component to send data to the
-remote host.</FONT>
-<BR>int send_to_server(){
-<BR>&nbsp;<FONT COLOR="#FF0000"> // Send data to server</FONT>
-<BR>&nbsp;ACE_OS::sprintf(data_buf_,"Hello from Client");
-<BR>&nbsp;for(int i=0;i&lt;NO_ITERATIONS; i++){
-<BR>&nbsp; if (client_stream_.send_n
-<BR>&nbsp;&nbsp;&nbsp; (data_buf_, ACE_OS::strlen(data_buf_), 0) == -1){
-<BR>&nbsp; ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) %p\n","send_n"),0);
-<BR>&nbsp; break;
-<BR>&nbsp; }
-<BR>&nbsp;}
-<BR>&nbsp;<FONT COLOR="#FF0000">//Close down the connection</FONT>
-<BR>&nbsp;close();
-<BR>}
-
-<P><FONT COLOR="#FF0000">//Close down the connection properly.</FONT>
-<BR>int close(){
-<BR>&nbsp;if (client_stream_.close () == -1)
-<BR>&nbsp; ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) %p\n","close"),-1);
-<BR>&nbsp;else
-<BR>&nbsp; return 0;
-<BR>&nbsp; }
-
-<P>private:
-<BR>&nbsp;ACE_SOCK_Stream client_stream_;
-<BR>&nbsp;ACE_INET_Addr remote_addr_;
-<BR>&nbsp;ACE_SOCK_Connector connector_;
-<BR>&nbsp;char *data_buf_;
-<BR>};
-
-<P>int main (int argc, char *argv[]){
-<BR>&nbsp;if(argc&lt;3){
-<BR>&nbsp; ACE_DEBUG((LM_DEBUG,?Usage egX &lt;hostname> &lt;port_number>\n?));
-<BR>&nbsp; ACE_OS::exit(1);
-<BR>&nbsp; }
-<BR>&nbsp;Client client(argv[1],ACE_OS::atoi(argv[2]));
-<BR>&nbsp;client.connect_to_server();
-<BR>&nbsp;client.send_to_server();
-<BR>}
-
-<P>&nbsp;<A HREF="ex03.html">Next Example</A>
-</BODY>
-</HTML>