The close() function used on sockets is defined in 'unistd.h'--it's now properly included.
Added a copy of strnstr() to the code in the event that it is not supplied by the OSs std libraries--as it is a non-standard call.