我需要在两台或更多台计算机之间传输字节数组. [英] i need to transfer byte Array between two computers or More.
本文介绍了我需要在两台或更多台计算机之间传输字节数组.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发应用程序.我有一个字节[],我想在两台或多台计算机之间共享.
就像会议...
我是这种概念的新手.我在Google上搜索了一下,发现TCP/Windows Services可以做到这一点.
任何人都可以告诉我该如何完成吗?
Prathamesh
Hi,
I am developing Application. I Have an Byte [] which i want to share between two or more computers.
Just like conferencing...
I am new to this type of concept. I googled and found TCP / Windows Services to acciomplish this.
Can Any tell me how should i Accomplish this ?
Prathamesh
推荐答案
看看C#中有关Chat,Socket,TCP/IP等的一些文章,您将学习如何通过套接字在计算机之间传输数据.
Take a look at some of the articles about Chat, Sockets, TCP/IP etc in C# where you will learn how to transfer data between computers via sockets.
使用C#进行套接字编程的初学者级别链接 [ ^ ]
嗯.
确定,您是要去客户端/服务器还是对等网络. CS更容易.确定您所说的分享是什么意思,这是否意味着所有内容都发送给了所有人?
如果性能至关重要,那么请忘记WCF之类的东西,您就不会击败原始套接字来加快传输二进制数据的速度.非常简单,在一端使用TcpListener并接受传入的连接.在另一个TcpClient上,并连接到侦听端.然后在TcpClients中的NetworkStream上向您发送byte [].
如果您需要高性能但可靠性较低(视频/音频会议等),则使用UDP会更好.
和往常一样,这个问题有点笼统.
Hmm.
Ok decide whether you want to go client/server or peer-to-peer. CS is easier. Decide what you mean by share, does that mean everything gets sent to everyone?
If performance is of importance forget WCF and stuff like that, you''re not going to beat a raw socket for speed transferring binary data. It''s pretty simple, use a TcpListener on one end and accept incoming connections. On the other a TcpClient and connect to the listening end. Then send you byte[] down the NetworkStream in the TcpClients.
If you need lots of performance but less reliability (video/audio conferencing and the like) you''d be better using UDP.
As usual, a bit too broad a question.
这篇关于我需要在两台或更多台计算机之间传输字节数组.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文