Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -199,13 +199,13 @@ port: (uint16_t)port; /*! * @brief Listen on the socket. * - * @param backLog Maximum length for the queue of pending connections. + * @param backlog Maximum length for the queue of pending connections. */ -- (void)listenWithBackLog: (int)backLog; +- (void)listenWithBacklog: (int)backlog; /*! * @brief Listen on the socket. */ - (void)listen; Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -508,22 +508,22 @@ errNo: EAFNOSUPPORT]; } - (void)listen { - [self listenWithBackLog: SOMAXCONN]; + [self listenWithBacklog: SOMAXCONN]; } -- (void)listenWithBackLog: (int)backLog +- (void)listenWithBacklog: (int)backlog { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; - if (listen(_socket, backLog) == -1) + if (listen(_socket, backlog) == -1) @throw [OFListenFailedException exceptionWithSocket: self - backLog: backLog + backlog: backlog errNo: of_socket_errno()]; _listening = true; } Index: src/exceptions/OFListenFailedException.h ================================================================== --- src/exceptions/OFListenFailedException.h +++ src/exceptions/OFListenFailedException.h @@ -30,11 +30,11 @@ * @brief An exception indicating that listening on the socket failed. */ @interface OFListenFailedException: OFException { id _socket; - int _backLog, _errNo; + int _backlog, _errNo; } /*! * @brief The socket which failed to listen. */ @@ -41,11 +41,11 @@ @property (readonly, nonatomic) id socket; /*! * @brief The requested back log. */ -@property (readonly, nonatomic) int backLog; +@property (readonly, nonatomic) int backlog; /*! * @brief The errno of the error that occurred. */ @property (readonly, nonatomic) int errNo; @@ -54,29 +54,29 @@ /*! * @brief Creates a new, autoreleased listen failed exception. * * @param socket The socket which failed to listen - * @param backLog The requested size of the back log + * @param backlog The requested size of the back log * @param errNo The errno of the error that occurred * @return A new, autoreleased listen failed exception */ + (instancetype)exceptionWithSocket: (id)socket - backLog: (int)backLog + backlog: (int)backlog errNo: (int)errNo; - (instancetype)init OF_UNAVAILABLE; /*! * @brief Initializes an already allocated listen failed exception * * @param socket The socket which failed to listen - * @param backLog The requested size of the back log + * @param backlog The requested size of the back log * @param errNo The errno of the error that occurred * @return An initialized listen failed exception */ - (instancetype)initWithSocket: (id)socket - backLog: (int)backLog + backlog: (int)backlog errNo: (int)errNo OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFListenFailedException.m ================================================================== --- src/exceptions/OFListenFailedException.m +++ src/exceptions/OFListenFailedException.m @@ -19,39 +19,39 @@ #import "OFListenFailedException.h" #import "OFString.h" @implementation OFListenFailedException -@synthesize socket = _socket, backLog = _backLog, errNo = _errNo; +@synthesize socket = _socket, backlog = _backlog, errNo = _errNo; + (instancetype)exception { OF_UNRECOGNIZED_SELECTOR } + (instancetype)exceptionWithSocket: (id)socket - backLog: (int)backLog + backlog: (int)backlog errNo: (int)errNo { return [[[self alloc] initWithSocket: socket - backLog: backLog + backlog: backlog errNo: errNo] autorelease]; } - (instancetype)init { OF_INVALID_INIT_METHOD } - (instancetype)initWithSocket: (id)socket - backLog: (int)backLog + backlog: (int)backlog errNo: (int)errNo { self = [super init]; _socket = [socket retain]; - _backLog = backLog; + _backlog = backlog; _errNo = errNo; return self; } @@ -64,8 +64,8 @@ - (OFString *)description { return [OFString stringWithFormat: @"Failed to listen in socket of type %@ with a back log of %d: %@", - [_socket class], _backLog, of_strerror(_errNo)]; + [_socket class], _backlog, of_strerror(_errNo)]; } @end