lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



And while I'm at it: you can improve the write section by replacing the

	length = strlen( data );

by a call to lua_strlen. That'll take embedded zeroes into account and will give the true length of the data (enabling you to send binary data, for images and such).

All this (and much more) can easily be gleaned from the Lua 5 reference manual. In this case the API section would be especially noteworthy:

	http://www.lua.org/manual/5.0/manual.html#3

I'd consider it required reading, well worth the little time needed to absord it.

Ashwin.
--
no signature is a signature.