Skip to content
Advertisement

Tag: c++

Bad File Descriptor on recv from TCP socket

I’ve got a trouble and can’t google out solution, so I hope you’ll be able to help me. There is a client-server application, something like text chat. Server accepts client’s connection, makes new socket for client and sends socket descriptor to it’s child process, that broadcasts received messages to all connected clients. server.c (error handling and tests are cuted out)

Programming in Linux – FIFO

I have created fifo, try to write to it: echo “text” > myfifo and read it with my programm. But when I write to fifo nothing shows. I have tried many options, turning off and on NON_BLOCK mode and so on but nothing seems to help. Answer This needs to be (there’s probably no need for the O_NONBLOCK flag, but

Reading corrupt file, segmentation fault

I run my program by passing it a bunch of directories like this: Each directory is a separate set of files that I am parsing for data which I then create into a spreadsheet. Each directory is a different row of the spreadsheet. I want to only put reliable data in the spreadsheet and so if an entry is missing

How to get the first address of initialized data segment

my program is working on linux using gcc. Through the manual page, I find edata, which represent the first address past the end of the initialized data segment. But I want know the first address of initialized data segment How can I get it? I have tried treating etext as the first address of initialized data segment. Then I got

“Alarm clock” message on linux

I’m working on a project written in C and I’m using alarms. In the beginning of the code I use sigaction() to initialize the alarm: Then I call the alarm with the alarm() function in a loop: The program sends the first alarm and runs the handler function, but when he sends the second one a message appears on the

delay output in c++ on linux

I want some random characters to be printed to console and then deleted by “b”. After this I want to put my own variable so it will be looking like “randomizing”. The problem is that it is happening too fast. I wanted to delay the output by using usleep or sleep function but when I’m using it, nothing is printed

OpenSSL verify_callback and SSL_connect

The SSL_CTX_set_verify() and SSL_set_verify() calls can be used to set the verify_callback() function for the underlying context and ssl, respectively. Here is a snippet from the documentation of verify_callback(): The return value of verify_callback controls the strategy of the further verification process. If verify_callback returns 0, the verification process is immediately stopped with “verification failed” state. If SSL_VERIFY_PEER is set,

Advertisement