in reply to Help with socket reading and returning
You do not initialise $message before the first time you call:
Correct this by using:
This page is intentionally left justified.