instrument socket functions