Created Socket class to overwrite write method and reraise errors.

Also, close socket if exception occurs.

Signed-off-by: Jesse Szwedko <j.szwedko@modcloth.com>
Added optional transport type :udp or :tcp

Defaulting to udp.

Signed-off-by: Jesse Szwedko <j.szwedko@modcloth.com>