Adding implementation of accept, close, getLastError, updateLastError, and printLastError. Also fixes for validateIP.