Click here to Skip to main content
15,914,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

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.
 
Share this answer
 
Comments
prathameshpitale 30-Sep-11 23:55pm    
Thank you.. Now i am using UDP to transfer byte[] from one comp to other. It works.. But I have some problem.
1) Server will be sending Some byte Array which size will be changing Many times.. How can i find out the size of Byte array from Server Machine on client machine
2) Speed of Transfer is slow.. 102400 bytes take more than 15 secs. to complete.. Can you suggest more for This?
Richard MacCutchan 1-Oct-11 3:19am    
1. The server should send a size value at the beginning of each block of data.
2. Check your code, network connections etc.
A beginner level link on socket programming in C#[^]
 
Share this answer
 
Comments
prathameshpitale 30-Sep-11 23:55pm    
Thank you.. Now i am using UDP to transfer byte[] from one comp to other. It works.. But I have some problem.
1) Server will be sending Some byte Array which size will be changing Many times.. How can i find out the size of Byte array from Server Machine on client machine
2) Speed of Transfer is slow.. 102400 bytes take more than 15 secs. to complete.. Can you suggest more for This?
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.
 
Share this answer
 
Comments
prathameshpitale 30-Sep-11 23:55pm    
Thank you.. Now i am using UDP to transfer byte[] from one comp to other. It works.. But I have some problem.
1) Server will be sending Some byte Array which size will be changing Many times.. How can i find out the size of Byte array from Server Machine on client machine
2) Speed of Transfer is slow.. 102400 bytes take more than 15 secs. to complete.. Can you suggest more for This?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900