The capabilities of sensor networking devices are increasing at a rapid pace. It is therefore not impractical to assume that future sensing operations will involve real time (inelastic) traffic, such as audio and video surveillance, which have strict bandwidth constraints. This in turn implies that future sensor networks will have to cater for a mix of elastic (having no bandwidth constraint requirements) and inelastic traffic. Current state of the art rate control protocols for wireless sensor networks, are however designed with focus on elastic traffic. In this work, by adapting a recently developed theory of utilityproportional rate control for wired networks to a wireless setting, and combining it with a stochastic optimization framework that results in an elegant queue backpressure-based algorithm, we have designed the first-ever rate control protocol that can efficiently handle a mix of elastic and inelastic traffic in a wireless sensor network. We implement this novel protocol in a real world sensor network stack, the TinyOS-2.x communication stack for IEEE 802.15.4 radios and evaluate the real-world performance of this protocol through comprehensive experiments on 20 and 40-node subnetworks of USC's 94-node Tutornet wireless sensor network testbed.