rearranged connect and send for clarity
fixed type of setsockopt
added binding for subscribe
error checking for subscribe
fixed pubsub example
fixed endpoint example