threadsafe network protocol