Adding arguments for passing sockets
Adjusting to use resource socket