Skip to content

Commit

Permalink
Added recv method that returns Data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron2920 committed Aug 7, 2021
1 parent 22456ed commit 864f61b
Show file tree
Hide file tree
Showing 39 changed files with 75 additions and 75 deletions.
10 changes: 5 additions & 5 deletions Sources/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ extension SwiftyZeroMQ {
return parts
}

/**
Receive a message part from the current socket
*/
public func recv(
public func recvData(
bufferLength : Int = 256,
options : SocketSendRecvOption = .none
) throws -> Data {
Expand Down Expand Up @@ -183,11 +180,14 @@ extension SwiftyZeroMQ {
return Data(bytes: buffer, count: Int(bufferSize))
}

/**
Receive a message part from the current socket
*/
public func recv(
bufferLength : Int = 256,
options : SocketSendRecvOption = .none
) throws -> String? {
return String(data: try recv(bufferLength: bufferLength, options: options), encoding: String.Encoding.utf8)
return String(data: try recvData(bufferLength: bufferLength, options: options), encoding: String.Encoding.utf8)
}

/**
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension SwiftyZeroMQ {
public func send(data: Foundation.Data, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws
public func sendMultipart(parts: Swift.Array<Foundation.Data>) throws
public func recvMultipart() throws -> Swift.Array<Foundation.Data>
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recvData(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Foundation.Data
public func recv(bufferLength: Swift.Int = 256, options: SwiftyZeroMQ.SwiftyZeroMQ.SocketSendRecvOption = .none) throws -> Swift.String?
public var hashValue: Swift.Int {
get
Expand Down
Binary file not shown.
Loading

0 comments on commit 864f61b

Please sign in to comment.