16,004,602 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 C++ questions
View Javascript questions
View Visual Basic questions
View .NET 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 15992924 (Top 13 by date)
Member 15992924
23-Jun-23 12:58pm
View
It does not end in null, it does not send me the 0 byte.
Member 15992924
23-Jun-23 12:57pm
View
It is also the way, depending on the option that I use, it responds to me in one way or another, but well, the option 1 that parses the data byte by byte in a file that is increasing, so how can I clean that parse_log file for the option 1 that I have put here before I start to write new data in the file? with "w+" in the parse_log with the byte by byte mode it doesn't work because each byte that I receive of information truncates the file because it executes the parse_log X times so for the moment I have it "a+" which is incremental. But I'm interested if I can clean the file with option 1 before it starts to write again data that I receive from the client-socket.
I know that on the client side I would have to send a 0 byte or a NULL to close the buffer, but they are not going to develop anything, they don't change me, I have to adapt because I am in the development phase.
Member 15992924
23-Jun-23 12:13pm
View
hyello update more clear problem and my testing can you see now thank and sorry for my english
Member 15992924
22-Jun-23 13:59pm
View
thank for answer i here other answer with more datas and problem. https://www.codeproject.com/Questions/5363350/Socket-server-C-linux-problem-write-data-receive-l
Member 15992924
22-Jun-23 12:57pm
View
hello I Update in post general datas code and explications thanks. I hope you understand my English, excuse me.
Member 15992924
22-Jun-23 12:57pm
View
hello I Update in post general datas code and explications thanks. I hope you understand my English, excuse me.
Member 15992924
22-Jun-23 12:56pm
View
Deleted
hello @all Update in post general datas code and explications.
Member 15992924
22-Jun-23 6:06am
View
Hello:
After putting this function to parse the socket information I encounter a problem, the data that the tcp socket client sends me I see that it takes a long time to arrive because it has to fill the buffer before sending me the data.
Can this not be removed so that it does not have to look at the buffer to complete the sending of data?
I have this Bug now in the application, the other end that sends me the data by TCP Socket has a sending every 10 seconds, and I see that it does not take until almost 1 minute to get the data because it establishes a connection and after 10 seconds is when it sends the data. data
Any idea how to fix this in this function?
Thanks in advance.
int i, r=1;
for(i=0; (i < sizeof(buf)) && (r >0); i++)
r = read_bytes(fd, &buf[i], 1));
write(stdout, buf, i);
write_line(fdout, buf i);
Member 15992924
16-May-23 3:28am
View
Thank you for your answer but I have tried this and it does not update the tables with the data, as I have commented, the .json files are deleted and created every 5 seconds that I receive the data through the TCP socket.
But still thanks for your contribution it helps me.
Member 15992924
12-May-23 4:35am
View
Thanks for answering, the information as it comes through TCP Socket and the parsing to json we do every 5 seconds that we receive the information through the TCP Socket.
I have created a bash with netcat to send data every 5 random seconds to see what changes that is not a problem
The only thing I don't know how to do what you're telling me about, I don't have much experience with Javascript and this part is getting complicated, if you can help me with this and tell me what example ajax code I could use?
thanks
Member 15992924
2-May-23 13:57pm
View
I have done what you told me and now I do not see the data that arrives in the shell and the file that I have put in the write_line creates a .txt and it does not leave me anything it does not write to me, I have two function options write_line I leave them to you here for you to see
Thanks for your help.
/*int write_line(char string[MAX_LENGTH])
{
FILE *fp;
fp = fopen("./vdn.log", "a+");
fwrite(string, sizeof ( char ), strlen(string), fp);
fclose(fp);
return 0;
}
*/
int write_line(char string[MAX_LENGTH]){
FILE *fp;
char* array = strdup(string);
char* filename="vdn.txt";
char* dir=get_current_dir_name();
char fullpath[MAX_LENGTH];
strcat(fullpath, dir);
strcat(fullpath, "/");
strcat(fullpath, filename);
fp=fopen(fullpath, "a"); if(fp==NULL) { return -1 ; } int i; for (i=0; i
Member 15992924
1-May-23 13:23pm
View
Thanks for your help. I have another part that is the write, but I don't know how to put it. Sorry for being so nobs. That is why I ask for help to see what I have to put at this point so that at the same time that it writes the data to the console, it writes it to a file.
The line breaks are not a problem but I don't know how to do this part that you commented on in the code. Thank you
Member 15992924
1-May-23 7:34am
View
And in which part do you think I should put it better? in the read?
Thanks for your quick response.
Show More