Refactored socket.c.
Refactored socket.c.

jparris/wmii.libixp,jparris/wmii.libixp,jerluc/wmii.libixp,wingyplus/wmii.libixp,rvedam/wmii.libixp,aztrock/wmii.libixp,rvedam/wmii.libixp,sunaku/libixp,sigmavirus24/wmii.libixp,captaincurrie/wmii.libixp,bwhmather/wmii.libixp,Sirikid/wmii.libixp,Fischx/wmii.libixp,sunaku/libixp,jparris/wmii.libixp,sigmavirus24/wmii.libixp,mortdeus/wmii.libixp,jerluc/wmii.libixp,darkfeline/wmii.libixp,hatliff/wmii.libixp,captaincurrie/wmii.libixp,aztrock/wmii.libixp,rvedam/wmii.libixp,bwhmather/wmii.libixp,captaincurrie/wmii.libixp,Sirikid/wmii.libixp,aztrock/wmii.libixp,Sirikid/wmii.libixp,hatliff/wmii.libixp,mortdeus/wmii.libixp,jerluc/wmii.libixp,mortdeus/wmii.libixp,darkfeline/wmii.libixp,sunaku/libixp,Fischx/wmii.libixp,hatliff/wmii.libixp,bwhmather/wmii.libixp,wingyplus/wmii.libixp,darkfeline/wmii.libixp,wingyplus/wmii.libixp,Fischx/wmii.libixp,sigmavirus24/wmii.libixp