I actually think that is already defined correctly so you can drop this and just use closesocket