             }
             return bytesSent
     }
-    public func send(to addr: AddrInfo, data: UnsafePointer<Void>,
+	/// Sends `data` to the specified peer.
+	///
+	/// If the socket is a connectionless socket, then it is acceptable
+	/// to provide different values for the address parameter. On the 
+	/// other hand, if the socket is connection orientated, the address
+	/// connected to must be provided. This is typically `self.address`.
+	/// The method `send(data:length:flags:maxSize)` has been provided 
+	/// for conviently calling `sendto`.
+	///
+	/// - parameters:
+	///		- address:		The address to send data to.
+	///		- data:			A pointer to the buffer to send.
+	///		- length:		The length of the buffer in bytes.
+	///		- flags:		Controls additional options for sending
+	///						data. Default is 0.
+	///		- maxSize:		The maximum size of each packet (in bytes) when 
+	///						sending large amounts of data. If a buffer is two
+	///						big to send, then it will be split into multiple
+	///						packets.
+	/// - Returns:
+	///						The number of bytes sent.
+	/// - Throws:
+	///		- `SocketError.SendToFailed`
+    public func send(to address: AddrInfo, data: UnsafePointer<Void>,
         length: Int, flags: Int32 = 0, maxSize: Int = 1024) throws -> Int {
 			var data = data 
             var bytesleft = length

                    data,
                    len,
                    flags,
                    nil,
                    0
                )
                guard success != -1 else {

            }
            return isSuccess
    }
	/// Sends a string to the peer.
	///
	/// This method adhers to the same requirements as the other, more advanced 
	/// `sendTo(_:data:length:flags:maxSize:)` method. The socket must have had
	/// it's address set, that is, if it's a connectionless socket, a call to `bind`
	/// or `connect`, and if its a connection orientated socket, it must be connected
	/// to a peer.
	///
	/// - parameters:
	///		- str:			The string to send. It's length is decoded using the
	///						NSUTF8StringEncoding interpretation.
	///		- flags:		Controls additional parameters determining the 
	///						behaviour of `send`.
	///		- maxSize:		Specifies the maximum size of packets. If a buffer
	///						exceeds this size, then it will be split into this size
	///						until the whole buffer is sent (unless a failure occurs).
	///	- Returns:
	///						The number of bytes sent.
	/// - Throws:
	///		- `SocketError.SendToFailed`
    public func send(str: String, flags: Int32 = 0, maxSize: Int = 1024) throws -> Int {
        let length = str.lengthOfBytesUsingEncoding(NSUTF8StringEncoding)
        return try self.send(str, length: length, flags: flags, maxSize: maxSize)
    }

	/// Sends `data` to the peer.
	///
	/// Allows the sending of data from the host to the peer. Attempting to send binary
	/// data this way is not a good idea (unless the format is exactly the same on the
	/// peer machine). It should instead be encoded, for example, by using base 64
	/// encoding.
	///
	/// This method adhers to the same requirements as the other, more advanced 
	/// function `sendTo(_:data:length:flags:maxSize:)`. The socket must have had its
	/// address set, either by a call to `connect` or by a call to `bind`.
	///
	/// - parameters: 
	///		- data:			The data to send.
	///		- flags:		Provides additional control parameters for `send`.
	///		- maxSize:		Specifies the maximum size of packets allow to be sent.
	///						Buffers which exceed this value will be split into small
	///						sizes, until the whole buffer is sent.
	/// - Returns:
	///						The number of bytes sent.
	///	- Throws:
	///		- `SocketError.SendToFailed`
    public func send(data: NSData, flags: Int32 = 0, maxSize: Int = 1024) throws -> Int {
        let len = data.length
        return try self.send(data.bytes, length: len, flags: flags, maxSize: maxSize)
    }
}
extension Socket {
