modified for "networkpackage" test based on an example of CocoaAsyncSocket