X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/19e61097c58079d6e317983f50006dc917d65cf7..02a3e582582c381f14bc23aa9bed4b4645a2f118:/src/syncio.c diff --git a/src/syncio.c b/src/syncio.c index 81eeda08..9958363b 100644 --- a/src/syncio.c +++ b/src/syncio.c @@ -1,9 +1,4 @@ -/* Synchronous socket I/O operations, with timeouts. - * Redis performs most of the I/O in a nonblocking way, with the exception - * of the SYNC command where the slave does it in a blocking way, and - * the MIGRATE command that must be blocking in order to be atomic from the - * point of view of the two instances (one migrating the key and one receiving - * the key). This is why need the following blocking I/O functions. +/* Synchronous socket and file I/O operations useful across the core. * * Copyright (c) 2009-2010, Salvatore Sanfilippo * All rights reserved. @@ -35,6 +30,14 @@ #include "redis.h" +/* ----------------- Blocking sockets I/O with timeouts --------------------- */ + +/* Redis performs most of the I/O in a nonblocking way, with the exception + * of the SYNC command where the slave does it in a blocking way, and + * the MIGRATE command that must be blocking in order to be atomic from the + * point of view of the two instances (one migrating the key and one receiving + * the key). This is why need the following blocking I/O functions. */ + int syncWrite(int fd, char *ptr, ssize_t size, int timeout) { ssize_t nwritten, ret = size; time_t start = time(NULL);