summaryrefslogtreecommitdiff
path: root/docs/tutorials
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2001-01-31 17:22:47 +0000
committerSteve Huston <shuston@riverace.com>2001-01-31 17:22:47 +0000
commit803d13ce2399f62466b99a71c90452b460cff39d (patch)
treeb2bfa645b8d22d606b31599cd626c42f89b3baff /docs/tutorials
parent0db9e6a0f675e2e8c4e6f77ddb62b83ef53bb4ef (diff)
downloadATCD-803d13ce2399f62466b99a71c90452b460cff39d.tar.gz
ChangeLogTag:Wed Jan 31 12:19:51 2001 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'docs/tutorials')
-rw-r--r--docs/tutorials/Chap_2/Chap_2.zipbin6712 -> 9758 bytes
-rw-r--r--docs/tutorials/Chap_2/ex03.html7
-rw-r--r--docs/tutorials/Chap_2/ex04.html7
3 files changed, 8 insertions, 6 deletions
diff --git a/docs/tutorials/Chap_2/Chap_2.zip b/docs/tutorials/Chap_2/Chap_2.zip
index e9201ef1925..fb356b7ee09 100644
--- a/docs/tutorials/Chap_2/Chap_2.zip
+++ b/docs/tutorials/Chap_2/Chap_2.zip
Binary files differ
diff --git a/docs/tutorials/Chap_2/ex03.html b/docs/tutorials/Chap_2/ex03.html
index 92882ac0a71..69e4a57c3c1 100644
--- a/docs/tutorials/Chap_2/ex03.html
+++ b/docs/tutorials/Chap_2/ex03.html
@@ -41,7 +41,7 @@ Accept it and display it.</FONT>
<BR><FONT COLOR="#FF0000">// After recieveing data immediately send some
data back to the remote.</FONT>
<BR>int accept_data(){
-<BR>&nbsp;while(local_.recv(data_buf,SIZE_DATA,remote_addr_)!=-1){
+<BR>&nbsp;while(local_.recv(data_buf,DATA_BUFFER_SIZE,remote_addr_)!=-1){
<BR>&nbsp; ACE_DEBUG((LM_DEBUG, "Data received from remote %s was %s \n"
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,remote_addr_.get_host_name(), data_buf));
<BR>&nbsp; ACE_OS::sleep(1);
@@ -57,9 +57,9 @@ the datagram component local_</FONT>
<BR>int send_data(){
<BR>&nbsp;ACE_DEBUG((LM_DEBUG,"Preparing to send reply to client %s:%d\n",
<BR>&nbsp; remote_addr_.get_host_name(),remote_addr_.get_port_number()));
-<BR>&nbsp;ACE_OS::sprintf(data_buf,"Server says hello to you too");
+<BR>&nbsp;ACE_OS::strcpy(data_buf,"Server says hello to you too");
<BR>&nbsp;if(
-<BR>&nbsp;local_.send(data_buf, ACE_OS::strlen(data_buf),remote_addr_)==-1)
+<BR>&nbsp;local_.send(data_buf, ACE_OS::strlen(data_buf)+1,remote_addr_)==-1)
<BR>&nbsp; return -1;
<BR>&nbsp;else
<BR>&nbsp; return 0;
@@ -75,6 +75,7 @@ the datagram component local_</FONT>
<P>int main(int argc, char *argv[]){
<BR>&nbsp;Server server(ACE_OS::atoi(argv[1]));
<BR>&nbsp;server.accept_data();
+<BR>&nbsp;return 0;
<BR>}
<P>&nbsp;<A HREF="ex04.html">Next Example</A>
diff --git a/docs/tutorials/Chap_2/ex04.html b/docs/tutorials/Chap_2/ex04.html
index e2a2c541487..716251de4ec 100644
--- a/docs/tutorials/Chap_2/ex04.html
+++ b/docs/tutorials/Chap_2/ex04.html
@@ -40,7 +40,7 @@ Mechanisms in ACE).</FONT>
<BR><FONT COLOR="#FF0000">//Accept data from the remote host using the
datgram component local_</FONT>
<BR>int accept_data(){
-<BR>&nbsp;if(local_.recv(data_buf,SIZE_DATA,remote_addr_)!=-1){
+<BR>&nbsp;if(local_.recv(data_buf,DATA_BUFFER_SIZE,remote_addr_)!=-1){
<BR>&nbsp; ACE_DEBUG((LM_DEBUG, "Data received from remote server %s
<BR>&nbsp;&nbsp;&nbsp;&nbsp; was: %s \n" ,remote_addr_.get_host_name(),
data_buf));
@@ -56,10 +56,10 @@ sent wait for a reply from</FONT>
<BR>int send_data(){
<BR>&nbsp;ACE_DEBUG((LM_DEBUG,"Preparing to send data to server %s:%d\n",
<BR>&nbsp;&nbsp; remote_addr_.get_host_name(),remote_addr_.get_port_number()));
-<BR>&nbsp;ACE_OS::sprintf(data_buf,"Client says hello");
+<BR>&nbsp;ACE_OS::strcpy(data_buf,"Client says hello");
<BR>&nbsp;
<BR>&nbsp;while(local_.send
-<BR>&nbsp;&nbsp;&nbsp; (data_buf,ACE_OS::strlen(data_buf),remote_addr_)!=-1){
+<BR>&nbsp;&nbsp;&nbsp; (data_buf,ACE_OS::strlen(data_buf)+1,remote_addr_)!=-1){
<BR>&nbsp; ACE_OS::sleep(1);
<BR>&nbsp; if(accept_data()==-1)
<BR>&nbsp;&nbsp; break;
@@ -81,6 +81,7 @@ sent wait for a reply from</FONT>
<BR>&nbsp;}
<BR>Client client(argv[1],ACE_OS::atoi(argv[2]));
<BR>client.send_data();
+<BR>return 0;
<BR>}
<BR>&nbsp;
<BR>&nbsp;<A HREF="ex05.html">Next Example</A>