Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
GeneralRe: Object Reference Required Pin
Heath Stewart9-Apr-04 4:01
protectorHeath Stewart9-Apr-04 4:01 
GeneralRe: Object Reference Required Pin
thewebmonster9-Apr-04 4:03
thewebmonster9-Apr-04 4:03 
GeneralRe: Object Reference Required Pin
Heath Stewart9-Apr-04 4:09
protectorHeath Stewart9-Apr-04 4:09 
GeneralRe: Object Reference Required Pin
thewebmonster9-Apr-04 4:13
thewebmonster9-Apr-04 4:13 
GeneralRe: Object Reference Required Pin
Michael P Butler9-Apr-04 1:08
Michael P Butler9-Apr-04 1:08 
GeneralRe: Object Reference Required Pin
thewebmonster9-Apr-04 1:21
thewebmonster9-Apr-04 1:21 
GeneralCLients Communication Pin
8-Apr-04 23:08
suss8-Apr-04 23:08 
GeneralRe: CLients Communication Pin
Colin Angus Mackay9-Apr-04 0:38
Colin Angus Mackay9-Apr-04 0:38 
peter micheal wrote:
i think that UDP is good,,,but i cannot understand it

I've never used UDP, but if you're going to be using sockets I think that TCP is a better option.

A good book on Sockets is C# Network Programming by Richard Blum. It describes UDP as a connectionless protocol. A quote from the book: "Connectionless sockets allow the sending of messages in self-contained packets. A single read method reads the entire message sent by a single send method... Unfortunately, UDP packets are not guaranteed to arrive at their desitnation" (pp210)

So, what I understand from this is that something sent via UPD must fit in one packet (typically 1500 bytes, which includes the space reserved for the IP headers) AND if you send a file this way it may not reach its destination. Certainly the books example code for using UDP never sends anything greater that 1kb.

If you are going to do network programming then I do recommend a good book on the subject. The one I mentioned above is an excellent book for use with C#. That way, if you do still have problems then you can be more specific in posting a question.

Back to your problem: You will need to have a process running on each of the clients that is acting as a server (it is able to receive incomming communications). If you say they are all clients you will go round in circles trying to figure out get them to communicate with each other. Always you need a client process (which initiates the request) and a server process (which responds to the request). In your cast a request is sending the file from one computer to another.

Next, you will need some protocol of your own to permit the transfer. You will need to tell the receiving computer (the server) how much data you are going to send at the very least so that it knows when to stop looking for more data. (You may also like to add in things like filename, timestamps, usernames and other relevant metadata) Now, there are off-the-shelf protocols already available in the .NET Framework that will assist you in this, but if you want to use Sockets you will have to do all the hard work yourself.

Does this help?


"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar

"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)


QuestionHow to Import Data from text file to SQL Server Pin
DucLinh8-Apr-04 22:53
DucLinh8-Apr-04 22:53 
GeneralRe: Import data into SQL Server from file text Pin
Michael P Butler8-Apr-04 22:29
Michael P Butler8-Apr-04 22:29 
GeneralMS Messsage Queue Pin
Login GoodSites8-Apr-04 19:38
Login GoodSites8-Apr-04 19:38 
GeneralRe: MS Messsage Queue Pin
Mazdak9-Apr-04 1:56
Mazdak9-Apr-04 1:56 
General.exe but no .dll Pin
Anonymous8-Apr-04 16:59
Anonymous8-Apr-04 16:59 
GeneralRe: .exe but no .dll Pin
Dave Kreskowiak8-Apr-04 17:31
mveDave Kreskowiak8-Apr-04 17:31 
GeneralRe: .exe but no .dll Pin
leppie9-Apr-04 6:59
leppie9-Apr-04 6:59 
GeneralChecking an objects inheritance Pin
cnurse8-Apr-04 15:25
cnurse8-Apr-04 15:25 
GeneralRe: Checking an objects inheritance Pin
jqd20018-Apr-04 18:32
jqd20018-Apr-04 18:32 
GeneralRe: Checking an objects inheritance Pin
Heath Stewart9-Apr-04 4:40
protectorHeath Stewart9-Apr-04 4:40 
GeneralInheriting attributes Pin
cnurse8-Apr-04 15:18
cnurse8-Apr-04 15:18 
GeneralRe: Inheriting attributes Pin
Heath Stewart9-Apr-04 4:33
protectorHeath Stewart9-Apr-04 4:33 
GeneralC# - Self documenting code Pin
cnurse8-Apr-04 15:13
cnurse8-Apr-04 15:13 
GeneralRe: C# - Self documenting code Pin
Heath Stewart9-Apr-04 4:27
protectorHeath Stewart9-Apr-04 4:27 
GeneralRunning Hello World examples, but MessageBoxIcon Enumeration[s] don't provide unique icons. Pin
Bupkus8-Apr-04 13:31
Bupkus8-Apr-04 13:31 
GeneralRe: Running Hello World examples, but MessageBoxIcon Enumeration[s] don't provide unique icons. Pin
Colin Angus Mackay8-Apr-04 14:12
Colin Angus Mackay8-Apr-04 14:12 
GeneralRe: Running Hello World examples, but MessageBoxIcon Enumeration[s] don't provide unique icons. Pin
Heath Stewart9-Apr-04 4:22
protectorHeath Stewart9-Apr-04 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.