C#中的应用程序间通信 [英] Inter-Application Communication in C#

查看:65
本文介绍了C#中的应用程序间通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个用C#WinForms开发的软电话......

现在我想用它添加XMPP聊天...

但问题是我害怕将XMPP功能添加到始终忙线程的软电话......

我怀疑是否会出现任何性能失败...所以我的问题是...

1.我可以将一些XMPP表单添加到在单独进程中运行的当前应用程序吗?

2.如果我将Softphone和XMPP作为不同的应用程序;我需要将XMPP的状态更新为(可用,随叫随到,响铃,立即忙等,因为此人使用Softphpne)

如果是,我如何将当前状态从Softphone发送到XMPP不同的应用程序?

哪种方式最好?

(A)我应该使用TCP监听器(这将为Softphone提供额外的工作)

(B)或者,我应该使用命令行参数(使用XMPP的单个实例,不知道性能)



请建议我...

Hi
I have a softphone developed with C# WinForms...
Now I want to add XMPP chat also with it...
But the problem is I am afraid to add XMPP feature also to always-busy-threaded softphone...
I suspect if any perfomance fail will come... So My question is...
1. Can I add some XMPP forms to the current application running in seperate processes ??
2. If I make Softphone and XMPP as different applications; I need to update the presence status of XMPP as (Available, On Call, Ringing, Busy Now etc automatically as the person uses Softphpne)
How can I send the current status from Softphone to XMPP if it is different application?
Which is the best way ?
(A) Should I use TCP Listeners (That will give extra work to the Softphone)
(B) or, I should use command-line parameters (Using Single instance of XMPP, Dont know about Perfomance)

Please suggest me...

推荐答案

我会使用在单独线程中运行的TCP侦听器。有几篇关于线程进程和主表单之间的通信的好文章,用代理搜索线程。



顺便说一下,尝试在另一个线程中使用表单相同的应用程序不是一个好主意。您可以开发2个使用TCP套接字相互更新的应用程序,或者您必须在同一个线程中使用所有表单。
I would use TCP listeners running in seperate threads. There are several good articles about communication between the threaded process and the main form, search for threading with delegates.

By the way, trying to use forms in another thread in the same application is not a good idea. You can develop 2 applications that update eachother with TCP sockets or you will have to use all forms in the same thread.


这篇关于C#中的应用程序间通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆