[Ace-users] [ace-users] A newbie question

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Sun Dec 9 08:47:11 CST 2007


Hi,

To ensure that we have proper version/platform/compiler information,
please make sure you fill out the appropriate problem report form
(PRF), which is in

$ACE_ROOT/PROBLEM-REPORT-FORM
$TAO_ROOT/PROBLEM-REPORT-FORM

or in

$ACE_ROOT/BUG-REPORT-FORM
$TAO_ROOT/BUG-REPORT-FORM

in older versions of ACE+TAO.  Make sure to include this information
when asking any questions about ACE+TAO since otherwise we have to
"guess" what version/platform/compiler/options you've using, which is
very error-prone and slows down our responsiveness.  If you don't use
the PRF, therefore, it is less likely that someone from the core
ACE+TAO developer team will be able to answer your question.
Naturally, we encourage and appreciate other members of the ACE+TAO
user community who can respond to questions that they have the answers
to.

Please note, moreover, that the DOC groups at Washington University,
UC Irvine, and Vanderbilt University only provide "best effort"
support for non-sponsors who are using the latest release, as
described in

http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/docs/ACE-bug-process.html

Therefore, please make sure you are using ACE+TAO+CIAO x.6.1 (i.e.,
ACE 5.6.1, TAO 1.6.1, and CIAO 0.6.1), which you can download from

http://download.dre.vanderbilt.edu

under the heading: "Latest Beta Kit".  If you need more "predictable"
help or need help for earlier versions of ACE+TAO+CIAO please see

http://www.cs.wustl.edu/~schmidt/commercial-support.html

for a list of companies that will provide you with ACE+TAO+CIAO
commercial support.

>Has anyone got the idea why the following server code does not create
>a socket with port assigned 1234. I checked with netstat that port was
>not created or not. I am very new to ACE and I wish to learn it.

Perhaps this port number is reserved on your OS and thus not available
to applications without special privileges.  I recommend you try using
a port number like 12345 and see if that works better.

Thanks,

        Doug

>
>#include "stdafx.h"
>#include "ace/INET_Addr.h"
>#include "ace/SOCK_Acceptor.h"
>#include "ace/SOCK_Stream.h"
>
>int _tmain(int argc, _TCHAR* argv[])
>{
>	ACE_INET_Addr server_addr;
>	ACE_SOCK_Acceptor acceptor;
>	ACE_SOCK_Stream peer;
>
>	if (server_addr.set(1234) == -1) return 1;
>	if (acceptor.open (server_addr) == 1) return 1;
>
>	char buf[20];
>
>	while(true)
>	{
>		acceptor.accept(peer);
>		peer.disable(ACE_NONBLOCK);
>		for(ssize_t n; (n=peer.recv(buf, sizeof buf)) > 0;)
>			ACE::write_n(ACE_STDOUT, buf, n);
> 	}
>	return 0;
>}
>
>
>
>
>Many thanks


-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list