Using C / C++ socket programming, and the "read(socket, buffer, BUFSIZE)" method. What exactly is the "buffer" I know that char and byte are the same thing, but does it ... |
I have this code
#define BUFFER_LEN (2048)
static float buffer[BUFFER_LEN];
int readcount;
while ((readcount = sf_read_float(handle, buffer, BUFFER_LEN))) {
// alsa play
}
which reads BUFFER_LEN floats from buffer, and returns the number of floats it ... |
I'm writing simple server/client in c, where server temporary stores message from client and retrieve it when client request it.
The problem is when client receives message from server, the buffer acts ... |
here i meet a strange problem about c read function in linux.
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
int main(int argc, char** argv){
int fd=open("a.c",O_RDONLY);
if(fd==-1){
...
|
In my socket code I have the following structure:
Server:
#include <stdio.h>
#include <stdlib.h>
...
|
If the return value of read() is the same as the buffer size, how do I read the rest of the information? If read is invoked again, will it read the ... |
Please excuse my lack of understanding, I'm a beginner with C. So, I have a void * buffer that I calloc like this:
void * dataBuffer = calloc(samples, sizeof(double));
and would like to ... |
|
@Raghu Thanks for your reply. The reason given by you can satisfy the problem when we accept "ch" as "char" i.e. using %c as format specifier. But when we are using "%s", it is accepting 'y' properly. If there are some characters left in buffer then it should read some garbage value.in place of 'y' also. Here, it is accepting 'y' ... |
I want to read a webpage in chart buffer and than i want to parse it. If have found out that "CInternetSession.OpenURL" is the way to do this, but now i seraching for a complete sample. Maybe a sample how to get the first 1000 or 2000 chars of a side into a buffer. Anybody have some link or advice ? ... |
|
Hello, the goal of my programe is to read from a log file "A" (comma delimited text file) which is generated when events occurs while the system is running and to extract some fields from that log file "A" and create a comma delimited text file "B" consists of the extracted fields from the parent log file "A". I have opted ... |
|
|
Hey all, I am trying to use an arbitrary size of count with the following code: while((n=read(file_desc[i], line, MAX_OUT)) > 0) { write(STDOUT_FILENO, line, n); ++i; Currently, I am using read() with a predefined MAX_OUT. I would rather this be arbitrary or to an EOF marker. I have been through unistd.h and don't see what I want. Any ideas on how ... |
|
Hello All, I have a small prog to connect to a web server and retrive a web page. The page look's like this: token1=value1 token2=value2 token3=value3 Then I read buffer like this: \ntoken1=value1\ntoken2=value2\ntoken3=value3\n\n\n I have to read line by line and split the results. I've tryed to use strsep but had no sucess. Can anybody help ? Thank's in ... |
|