Lander
✅ Recieve less than transmitting in network stream
Hello there, I'm trying to implement a FTP server and I got troubles with the network stream
Whenever I transmit a 4669 file, I recieve only 3779 and it's sending 0 which as it says marks the end of the data.
The headers I sent indicate the file's size so I know exactly how much to expect and I got the conditions for it.
I have tried almost everything I could think of.
Here is the code for the server:
Here is the code of the client:
in both is an instace of Network stream created with the underlying socket of TcpClient.
I would appreciate any help.
Thank you.
4 replies
❔ Winforms one window app with navigation between windows
Hello there, I'm trying to implement a one window winforms app with navigation between the various forms using a dictionary and abit of manipulation with Dispose and Application.Run()
Here is a snippet of the running loop code
In each form when the user goes to the next, I call Dispose().
In terms of memory, when I tested going back and forth on 2 forms, the Task Manager shown that the memory didn't significantly bypassed the 30-50 MB threshold and at one point dropped to the starting 18 MB.
My question is, Is this way hacky and unsafe or it's fine?
2 replies
❔ logs with network file sending
Hello there, I'm currently in the process of writing a FTP server and I want to implement a logging system to ensure that both parties are in conisistent state.
I know there is the method SendFile() but looking at the documention, doesn't show much beyond simply calling.
Is there another function which gives takes abit of load off or the only solution will be to manually send the bytes and log it myself?
Thank you.
4 replies
❔ Autoresetevent
Hello there, does the state of the Set() method of the object persists until another thread performs a WaitOne() on it?
Like if it happens that a manager thread do a Set() and the worker thread didn't arrive to the WaitOne() yet, will the state persist until the worker thread arrive and change the state?
8 replies