15,746,813 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View C++ questions
View Python questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 14623639 (Top 23 by date)
Member 14623639
1-Feb-23 4:53am
View
How will this affect my goal?
Member 14623639
31-Jan-23 8:31am
View
Yes. I will try to use more thread and also will work on my database code. Thank you so much.
Member 14623639
31-Jan-23 3:38am
View
Yes you are right. After commenting out some code the sockets weren't disconnecting but I still don't get it as I understood that too many processes in the application are causing this but how do they lead sockets(async) to disconnect? Because this has never happened before and I'm curious to know what is it exactly happening causing this issue.
Member 14623639
31-Jan-23 2:38am
View
Are these some mistakes that are causing the socket to disconnect?
Member 14623639
20-Jan-23 3:40am
View
I tried using Encoding.UTF8.GetBytes() and Encoding.UTF8.GetString().
I tried
byte[] dataRead = File.ReadAllBytes(op.FileName);
byte[] data = Encoding.UTF8.GetBytes(Encoding.UTF8.GetString(dataRead));
to get the file into UTF8 and after writing it returns with corrupt file with invalid size
File.WriteAllBytes(filenameandpath, data);
Member 14623639
19-Jan-23 23:55pm
View
So should I change my whole architecture of the application to UTF8Encoding? Because how my application works is client request server data by sending a string as request type|request data|ip address and server replies with request type|requested data|actual data so this is all happening in ASCII. So are you suggesting me to do everything in UTF8Encoding, UnicodeEncoding, or UTF32Encoding?
Second, I'm using byte[] dataToDownload = Encoding.ASCII.GetBytes(dataString); and later using it in File.WriteAllBytes() which is not working.
Member 14623639
11-Jan-23 0:02am
View
Hello Pete, thanks for your reply. I have noted your points and would definitely implement them in my program and also in my habits.
Member 14623639
31-Dec-22 23:20pm
View
Sure I will try to implement it.
Member 14623639
30-Dec-22 22:41pm
View
Will the sending of whole info into single message be a mess because server wouldn't know how much to receive?
and regarding the network transfer I'm renting a server i.e. Amazon EC2 or Azure Webjobs.
Member 14623639
30-Dec-22 12:27pm
View
Yes, thanks for the information but this is for personal and limited use so file size is not large but still would you let me know any tutorials where I can get knowledge about how can I recognize change on the screen?
I'm new to this and very much eager to learn.
Member 14623639
30-Dec-22 12:23pm
View
Oh now I got it. So I should receive data from client and send an acknowledgement back to client and client should send the data and wait for correct acknowledgement from server to send next data?
Member 14623639
30-Dec-22 9:02am
View
To make things clear. The client is the sender here and the server is the receiver. FYI I'm not assuming here I've demonstrated and replied to you. In my case this is what happening
Client sends the size(logged and checked)
Server receives it
Client sends the data(logged and checked)
Server receives it and checks for the size
Client sends the size(logged and checked)
Server receives it but incorrectly
Client sends the data(logged and checked)
Server receives it and checks for the size
As I've said I tried to check both the sides the sender and receiver(with catch block to log the errors) and client is sending data correctly as I have logged the data sent and error message too. Client is not throwing any error and data sent is also correct.
With server the case is that server receives the size at first which itself is incorrect and if you're saying that previous data might be out of sync so that has not happened because previous data was successfully sent and received. So taking the incorrect value as size the server declares a byte[incorrect size] to receive the data and as size is incorrect the byte[] throws an error.
Member 14623639
30-Dec-22 7:59am
View
The exception is ok but my question is regarding the value that is causing the compiler to throw error. Exception is thrown on overflow of byte[] but the value i.e. data size is incorrect comparing to what is sent and that size is throwing exception. I don't know what is happening to the data size when received on server.
Member 14623639
30-Dec-22 4:09am
View
Server is throwing "Exception of type 'System.OutOfMemoryException' was thrown." on byte[] data = new byte[size]; as the value I got is "1734438217".
Member 14623639
30-Dec-22 2:52am
View
I said "Also I tried logging exceptions as you said but it seems client is not throwing any exceptions"
Member 14623639
30-Dec-22 2:21am
View
Actually the data is sent correctly from the client as you can see in the results on sent byte[] value from client. Also I tried logging exceptions as you said but it seems client is not throwing any exceptions and working correctly. I think the problem is with the server as it seems it's messing with the byte[] of datasize.
Member 14623639
18-Dec-22 22:42pm
View
Thanks for the answer. I will check this.
Member 14623639
18-Dec-22 10:43am
View
How can I achieve sending image file name and image both in the same byte[]?
Member 14623639
18-Dec-22 9:33am
View
The code is my previous code that works but I using that same working byte[] to convert to string and again to byte[] won't work.
Member 14623639
5-Nov-22 0:32am
View
Thanks for your solution but I tried using binary formatter method before and it's very slow process as it gives me 3fps on my local server and I can't imagine how slow it would process if I used a hosted server on the internet.
Member 14623639
5-Nov-22 0:30am
View
but how can I work with while(true) in both write and read? As if I'm reading the chunked data received in a while loop get total number of bytes received but write keeps writing the data in the networkstream and this causes the chunk reading to go in infinite loop.
Member 14623639
28-Sep-22 12:17pm
View
I have searched it for weeks but still no luck. What making me mad is there are some other applications have that functionality but I can't find any solution till date.
Member 14623639
28-Sep-22 12:00pm
View
This is not what I want. I want to fetch skype conversation from skype installed on the system to my c# application.
Show More