找回密码
 用户注册

QQ登录

只需一步,快速开始

楼主: xtdwnuisea

关于service configure 和 streams 能结合起来吗?

[复制链接]
 楼主| 发表于 2010-1-8 17:17:35 | 显示全部楼层
modern

的确是强人呀, 你说的是对的, 服务配置框架已经帮我们把stream与module结合起来了;

在CCM_App工程中遇到一个问题, 在make_stream()刚建立好流后, 立即压入消息是不对的, 我以前错了两个地方:
1. 就是您说的:没有自己调度消息
2. 在make_stream()函数中刚 new完流就进行消息压入;

现在我在make_stream()中创建一个线程,等Module全部压入流以后,再在我的工作线程中向流中压入消息; 这样就没有问题了;

与你进行深层次交流真是一件大快人心的事呀:) 非常感谢您在这件事情上对我的提醒与深度交流!

[ 本帖最后由 xtdwnuisea 于 2010-1-8 17:19 编辑 ]
发表于 2010-1-11 09:51:03 | 显示全部楼层
公司曾经使用stream来开发一个通讯系统,但当软件开发完成以后,才发现会出现shutdown
楼上各位要小心下面的情况。
SEGV during shutdown with ACE Streams
from [Chad Beaulac]


Subject: SEGV during shutdown with ACE StreamsFrom: Chad BeaulacDate: Thu, 29 May 2008 06:08:19 -0700 PDTNewsgroups: comp.soft-sys.ace
file:///F:/project/P-软总线/V-版本/DDS/SEGV%20during%20shutdown%20with%20ACE%20Streams.files/banner_en.jpg     ACE VERSION: 5.6.3, 5.6.4, 5.6.5    HOST MACHINE and OPERATING SYSTEM:        Fedora Core 7 and 8, AS 4.5    TARGET MACHINE and OPERATING SYSTEM, if different from HOST:    COMPILER NAME AND VERSION (AND PATCHLEVEL):    same    THE $ACE_ROOT/ace/config.h FILE:    #define ACE_HAS_REACTOR_NOTIFICATION_QUEUE    #include "ace/config-linux.h"    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:    no_hidden_visibility = 1    include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU    AREA/CLASS/EXAMPLE AFFECTED:    $ACE_ROOT/examples/ASX/CCM_App    ./server -f svc.conf    DOES THE PROBLEM AFFECT:        COMPILATION? no        LINKING? no        EXECUTION? yes        OTHER (please specify)?     ACE and the example application are affected    SYNOPSIS:    When you hit Ctrl-C or Ctrl-D to stop the example server program,it core dumps with a SEGV during shutdown.    DESCRIPTION:    I have a processing framework for real-time processing systems andI'd like to convert it to use the ACE Streams framework whereapplicable. A SEGV during shutdown isn't acceptable in my office so Ican't use the Streams framework yet.    REPEAT BY:    Run $ACE_ROOT/examples/ASX/CCM_App/server -f $ACE_ROOT/examples/ASX/CCM_App/svc.conf    SAMPLE FIX/WORKAROUND:    none at this time
发表于 2010-1-11 16:07:48 | 显示全部楼层
原帖由 xtdwnuisea 于 2010-1-7 15:20 发表
CCM_App 这个项目我已经能运行起来

问一下楼主,为什么这个例子运行会出错呢,window系统

我用server.exe -d -f svc.conf运行的
发表于 2010-1-12 15:07:46 | 显示全部楼层
static ACE_Service_Manager "-d -p 4911"

dynamic Test_Task Service_Object *CCM_App:_make_Test_Task() "-p 3000"

#stream dynamic CCM_App STREAM *CCM_App:make_stream() active
{
  dynamic Device_Adapter Module *CCM_App:make_da()
  dynamic Event_Analyzer Module *CCM_App:make_ea()
  dynamic Multicast_Router Module *CCM_App:make_mr() "-p 3001"
}

#stream CCM_App
{
  remove Device_Adapter
  remove Event_Analyzer
  remove Multicast_Router
}

remove CCM_App
remove Test_Task


如果svc.conf是这样的就不会出错,也就是说将三个Module加载到Service configraturor中是不会出错;
但是不能将Stream加载到Service configraturor中,也不能将三个Module加载到Stream中;
我就用ACE version 5.6的自带的例子ACE_wrappers\examples\ASX\CCM_App;
不知道是我哪里没有弄对,希望两位能给指点一下,感谢
 楼主| 发表于 2010-2-1 18:11:56 | 显示全部楼层
Module可以加载到Stream中
Stream可以加载到service configure中


在主应用程序中,还可以使用迭代的方式,取到service configure中Stream的指定,向stream中压入消息, 这个贴子在modern
的帮助下,一直讨论的这个话题


关于如何迭代,在test项目中还有例子;

[ 本帖最后由 xtdwnuisea 于 2010-2-1 18:13 编辑 ]
发表于 2010-4-20 09:58:10 | 显示全部楼层
"在主应用程序中,还可以使用迭代的方式,取到service configure中Stream的指定,向stream中压入消息" 他最后这么说,我会迭代,但我只能得到名字,而不能 取到service configure中Stream的指定,向stream中压入消息,      因为我取到名字后,使用ACE_Dynamic_Service,只能得到ACE_Service_Object派生类对象。而ACE_Stream不行。
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-5-3 03:27 , Processed in 0.016743 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表