Click here to Skip to main content
15,889,992 members
Home / Discussions / C#
   

C#

 
GeneralRe: Enterprise Library V5 Logging Pin
dan!sh 22-Dec-10 21:53
professional dan!sh 22-Dec-10 21:53 
GeneralRe: Enterprise Library V5 Logging Pin
Ray Cassick22-Dec-10 22:10
Ray Cassick22-Dec-10 22:10 
QuestionLooking at the remote desktop template, help with automating acknowledgement of the legal banner [modified] Pin
turbosupramk322-Dec-10 8:26
turbosupramk322-Dec-10 8:26 
AnswerRe: Looking at the remote desktop template, help with automating acknowledgement of the legal banner Pin
Richard MacCutchan22-Dec-10 8:59
mveRichard MacCutchan22-Dec-10 8:59 
AnswerRe: Looking at the remote desktop template, help with automating acknowledgement of the legal banner [modified] Pin
RaviRanjanKr22-Dec-10 17:39
professionalRaviRanjanKr22-Dec-10 17:39 
GeneralRe: Looking at the remote desktop template, help with automating acknowledgement of the legal banner Pin
turbosupramk323-Dec-10 0:16
turbosupramk323-Dec-10 0:16 
QuestionHow do I transfer files over a local network? Pin
Megidolaon22-Dec-10 7:12
Megidolaon22-Dec-10 7:12 
AnswerRe: How do I transfer files over a local network? PinPopular
Luc Pattyn22-Dec-10 8:54
sitebuilderLuc Pattyn22-Dec-10 8:54 
Hi,

that does not look good.

1.
Megidolaon wrote:
while (data > 0)

the test fails right away, so nothing gets sent.

2.
Megidolaon wrote:
data = fstream.ReadByte();

Now why would you handle one byte at a time? it will take forever on medium-sized files, and even longer on large ones.
You are trying to receive 1024 bytes, why not do something similar on the sender side?
Use a byte array, Stream.Read(), and make sure to watch the actual number of bytes transferred.

3.
Megidolaon wrote:
the code never reaches the invoke call

see (1)

4.
Megidolaon wrote:
I tried a SoapFormatter

I have no idea why you would use a formatter. Sockets don't care about the data they carry.

5.
Megidolaon wrote:
I used int.MaxValue

If the method needs to allocate a buffer, it will fail to get int.MaxValue bytes of memory, no matter how much RAM your system has.


I suggest you try something like this as a sender (not tested!):
int DIM=1024;
byte[] bytes=new byte[DIM];
for(;;) {
    int count=fstream.Read(bytes, 0, DIM);
    if (count==0) break;
    nstream.Write(bytes, 0, count);
}


Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

GeneralRe: How do I transfer files over a local network? Pin
Megidolaon22-Dec-10 10:12
Megidolaon22-Dec-10 10:12 
GeneralMy vote of 1 Pin
Keith Barrow22-Dec-10 10:33
professionalKeith Barrow22-Dec-10 10:33 
GeneralRe: My vote of 1 Pin
Megidolaon23-Dec-10 7:55
Megidolaon23-Dec-10 7:55 
GeneralRe: My vote of 1 Pin
Keith Barrow23-Dec-10 7:59
professionalKeith Barrow23-Dec-10 7:59 
GeneralRe: How do I transfer files over a local network? Pin
Henry Minute22-Dec-10 10:34
Henry Minute22-Dec-10 10:34 
GeneralRe: How do I transfer files over a local network? Pin
Luc Pattyn22-Dec-10 10:34
sitebuilderLuc Pattyn22-Dec-10 10:34 
GeneralRe: How do I transfer files over a local network? Pin
Keith Barrow22-Dec-10 10:38
professionalKeith Barrow22-Dec-10 10:38 
GeneralRe: How do I transfer files over a local network? Pin
fjdiewornncalwe22-Dec-10 10:41
professionalfjdiewornncalwe22-Dec-10 10:41 
GeneralRe: How do I transfer files over a local network? PinPopular
Pete O'Hanlon22-Dec-10 10:46
mvePete O'Hanlon22-Dec-10 10:46 
GeneralRe: How do I transfer files over a local network? PinPopular
Richard MacCutchan22-Dec-10 11:18
mveRichard MacCutchan22-Dec-10 11:18 
GeneralRe: How do I transfer files over a local network? Pin
dan!sh 22-Dec-10 20:24
professional dan!sh 22-Dec-10 20:24 
GeneralRe: How do I transfer files over a local network? Pin
Richard MacCutchan22-Dec-10 21:59
mveRichard MacCutchan22-Dec-10 21:59 
GeneralRe: How do I transfer files over a local network? Pin
_Erik_23-Dec-10 3:32
_Erik_23-Dec-10 3:32 
AnswerRe: How do I transfer files over a local network? Pin
jschell23-Dec-10 7:08
jschell23-Dec-10 7:08 
QuestionApproximation Taylor and Furie series with neuro network Pin
elinehsani22-Dec-10 0:12
elinehsani22-Dec-10 0:12 
AnswerRe: Approximation Taylor and Furie series with neuro network Pin
phil.o22-Dec-10 0:23
professionalphil.o22-Dec-10 0:23 
AnswerRe: Approximation Taylor and Furie series with neuro network Pin
Pete O'Hanlon22-Dec-10 0:25
mvePete O'Hanlon22-Dec-10 0:25 

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.