remove Data dependency

This commit is contained in:
Paulo Faria 2016-04-12 02:55:59 -03:00
parent 85fee5fac5
commit 0572420ed0
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@
// SOFTWARE. // SOFTWARE.
import CZeroMQ import CZeroMQ
import Data import C7
public struct SendMode : OptionSet { public struct SendMode : OptionSet {
public let rawValue: Int public let rawValue: Int
@ -143,7 +143,7 @@ public final class Socket {
} }
public func receive(bufferSize bufferSize: Int = 1024, mode: ReceiveMode = []) throws -> Data? { public func receive(bufferSize bufferSize: Int = 1024, mode: ReceiveMode = []) throws -> Data? {
var data = Data.bufferWithSize(bufferSize) var data = Data.buffer(with: bufferSize)
let result = zmq_recv(socket, &data.bytes, bufferSize, Int32(mode.rawValue)) let result = zmq_recv(socket, &data.bytes, bufferSize, Int32(mode.rawValue))
if result == -1 && zmq_errno() == EAGAIN { if result == -1 && zmq_errno() == EAGAIN {
return nil return nil