首页 \ 问答 \ TCL:Windows中线程之间的双向通信(TCL: Two way communication between threads in Windows)

TCL:Windows中线程之间的双向通信(TCL: Two way communication between threads in Windows)

我需要在Tcl中的线程之间进行双向通信,而我所能得到的只是一种方式,参数传入作为我唯一的master-> helper通信通道。 这是我有的:

proc ExecProgram { command } {
    if { [catch {open "| $command" RDWR} fd ] } {
        #
        # Failed, return error indication
        #
        error "$fd"
    }
}

要调用tclsh83,例如ExecProgram“tclsh83 testCases.tcl TestCase_01”

在testCases.tcl文件中,我可以使用传入的信息。 例如:

set myTestCase [lindex $argv 0] 

在testCases.tcl中我可以输出到管道:

puts "$myTestCase"
flush stdout

并使用进程ID接收放入主线程的内容:

gets $app line

......在一个循环中。

哪个不太好。 而不是双向的。

任何人都知道在两个线程之间的Windows中的tcl简单的双向通信方法?


I need to have two way communication between threads in Tcl and all I can get is one way with parameters passing in as my only master->helper communication channel. Here is what I have:

proc ExecProgram { command } {
    if { [catch {open "| $command" RDWR} fd ] } {
        #
        # Failed, return error indication
        #
        error "$fd"
    }
}

To call the tclsh83, for example ExecProgram "tclsh83 testCases.tcl TestCase_01"

Within the testCases.tcl file I can use that passed in information. For example:

set myTestCase [lindex $argv 0] 

Within testCases.tcl I can puts out to the pipe:

puts "$myTestCase"
flush stdout

And receive that puts within the master thread by using the process ID:

gets $app line

...within a loop.

Which is not very good. And not two-way.

Anyone know of an easy 2-way communication method for tcl in Windows between 2 threads?


原文:https://stackoverflow.com/questions/267420
更新时间:2023-08-23 10:08

最满意答案

问题可能是返回TYPO3站点时未触发您的身份验证服务。 您的服务是否会触发取决于几个配置选项。 默认情况下,您的服务仅在POST登录操作发生时触发 - 但是有一些选项可以定义,例如,即使没有POST登录,身份验证服务也必须始终尝试获取(并因此验证)用户数据(相反,GET参数可用于确定是否应尝试身份验证)。

如果您打算使用此方法登录BE用户,还有一个警告。 我注意到,如果您尝试在FE中登录BE用户,则除非存在现有BE用户cookie(如果您已登录BE,它将会出现),则不会遵守任何操作或配置。 如果您使用身份验证服务通常登录到BE,则不存在此问题 - 仅当您尝试在FE中执行此操作时才适用。

TL; DR:我猜你需要使用此链接的“高级”部分中描述的参数为目标BE / FE上下文配置“always auth user”设置: https//docs.typo3.org/ typo3cms / Typo3ServicesReference /验证/ index.html中


The problem was resolved creating a new plugin. In the configuration of application in Twitter I can not set parameters as controller and actions, for example; only the page id. I had to create a plugin in my TYPO3 extension that execute in one page the action for get information of callback, process and return the page with the list of social profiles. This We did it in each one social networks (Facebook, Google+ and Instagram) for their callback URL to be correct.

相关问答

更多
  • 您可以使用扩展名“extension_builder”。 它生成(骨架)基于extbase /流体的扩展,并与TYPO3 6.0兼容(甚至在生成的扩展中使用命名空间,这仅在6.0中引入)。 如果您想构建流媒体/扩展程序扩展,您应该阅读本书以熟悉这些扩展。 在德国,它也可以作为平装本。 我不确定“kickstarter”扩展是否仍然有效,但它的最后更新是一个维护版本,使其在TYPO3 v4.6中工作,所以它很有可能。 You can use the extension "extension_builder". ...
  • 我想你已经在https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/Templates/TwitterBootstrap/Index.html上看到了关于twitter bootstrap的手册。 订单应该是: 新闻 新闻TWB 您的sitepackage扩展程序 在常量的站点包扩展中,您可以覆盖常量 plugin.tx_news { view.twb { # cat=plugin.tx_news/fil ...
  • 最有可能的是,您需要在目标计算机上的Extenion Manager检索/更新扩展列表。 另外请记住,默认情况下,EM会选择随机镜像,因此如果您的分机在很久以前上传,则每个镜像可能需要一些时间。 另一方面... 如果只想在多个实例之间共享,只需将它在源计算机上导出到t3x文件,然后从文件导入,则无需将其发布到TER。 您也可以将整个扩展文件夹从源计算机的typo3conf/ext文件夹复制到目标计算机上的同一文件夹,然后它将处于与从repo下载的相同状态,但尚未安装。 Most probably you n ...
  • 您获得的错误来自您尝试创建的存储库。 TYPO3\CMS\Extbase\Persistence\Repository有一个构造函数,它需要\TYPO3\CMS\Extbase\Object\ObjectManagerInterface作为参数。 由于您未在t3lib_div::makeInstance传递objectManager类,因此会引发错误。 您可以通过使用如下所示的依赖注入来避免这种情况。 /** * @var Tx_Mtclnt_Domain_Repository_AdsRepository ...
  • (更新以反映讨论的状态) 1138行应为: return $this->materials; (Updated to reflect state of discussion) Line 1138 should read: return $this->materials;
  • 检查模板文件名的首字母大写。 规则是,对于名为fooBarAction()动作,模板文件必须命名为FooBar.html Check so template filename has first letter uppercase. The rule is that for action named fooBarAction() template file must be named FooBar.html
  • 有一个Scheduler,应该通过cronjob执行。 您可以从扩展中将自己的任务添加到调度程序,并定义应该执行的频率。 调度程序带有核心。 你可能需要安装它。 有关如何操作的更多信息: http://docs.typo3.org/typo3cms/extensions/scheduler/latest/DevelopersGuide/CreatingTasks/Index.html http://www.typo3lexikon.de/typo3-tutorials/extensions/schedule ...
  • 问题可能是返回TYPO3站点时未触发您的身份验证服务。 您的服务是否会触发取决于几个配置选项。 默认情况下,您的服务仅在POST登录操作发生时触发 - 但是有一些选项可以定义,例如,即使没有POST登录,身份验证服务也必须始终尝试获取(并因此验证)用户数据(相反,GET参数可用于确定是否应尝试身份验证)。 如果您打算使用此方法登录BE用户,还有一个警告。 我注意到,如果您尝试在FE中登录BE用户,则除非存在现有BE用户cookie(如果您已登录BE,它将会出现),则不会遵守任何操作或配置。 如果您使用身份验 ...
  • 是的,这似乎是一个只会影响谷歌Chrome的已知错误 。 我无法使用最新的Chrome(58.x)重现它。 所以我假设编辑使用谷歌Chrome并且尚未更新它? Yes, this seems to be a known bug that only affects Google Chrome. I Couldn't reproduce it with latest Chrome (58.x) though. So I assume the Editor uses Google Chrome and has y ...
  • 也许你正在使用page.10.variables ? 在这里查看我的答案流体模板中typoscript的最佳用法是什么? Maybe you are using page.10.variables? Check my answer here what is the best usage of typoscript in fluid templates?

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。