jwatte's picture

boost::asio async_read_until may read more than the specified data!

This took me a while to track down. I figured I'd document it for posterity, and anyone else trying to do asynchronous networking in C++ using boost::asio. I'm using Ubuntu Server 10.04 LTS with gcc/g++, which uses boost version 1.40. The reason is that the "bytes transferred" argument to the callback is the number of bytes until the separator is found, but more bytes than that are decoded from the socket into the input stream.

jwatte's picture

A hexagon texture. For free!

Here's a PNG file of a hexagon. The hexagon itself is 256 pixels wide and 225 pixels tall. The PNG is 290 pixels wide and 290 pixels tall. You can use this to generate hex tile grids in HTML and Canvas and XNA and really any other presentation framework you want!

jwatte's picture

Measuring scheduling latency on virtualized versus bare hardware

The scheduling latency is the longest time that a "ready" process may have to wait before it actually gets to run.
On a system with a single CPU/core, and many ready processes, this latency will be very long.
On a system that is idle, and has many free CPUs/cores, it should theoretically be zero.

jwatte's picture

Linux mmap() ENOMEM error causing Segmentation Fault

I have a system that creates files on disk, then uses mmap and madvise and mflush to asynchronously do I/O to the disk. This system may potentially create many, many files, each of which will have three mmap sections, that will be rotated through the file.

Building interactive games on top of a web/HTTP technology stack

I recently answered question on the gamedev.net multiplayer and networking forum, that I feel warrants further distribution. The question dealt with trying to use MySQL eventing and MySQL data as the "server" for a large-scale multi-player web-based game.

jwatte's picture

Visual C++ doesn't have strtoll(): use _strtoi64() instead

When building code you port from Linux (or other GCC based systems) to Visual Studio, you may run into the Microsoft standard C library not containing a definition for strtoll(), which converts from a C string to a long long, 64-bit integer value.

error C3861: 'strtoll': identifier not found

jwatte's picture

Highscores for XNA 4.0 test release

I've heard the requests, and decided that they are right: It's better to release something that probably works for Xbox for XNA 4.0 now, and then follow up with the Phone version later.

jwatte's picture

The state of COLLADA, FBX, and open source

Here's what I want to do:

jwatte's picture

Lead Game Tester: 60 dollars a year?

I recently saw this ad:

A whole 60 dollars a year? That's cheaper than outsourcing to Congo! (the poorest nation on Earth).

Job recruiting scam pro-tip: Proofread your ads!

jwatte's picture

FFT in XNA Content Pipeline for Beat Detection For The Win!

I worked a bit more on the FFT-based music visualizer program I started the other day, and it's doing great! A this point, I have a pretty solid rhythm extraction thing going, and I can use autocorrelation (through autoconvolution) of the extracted rhythm track to derive tempo. I'm assuming 4/4 beats here, but...

Syndicate content