]> git.saurik.com Git - cycript.git/blob - Network.cpp
Further makefile reorganization, header file fixes, code movement, and general massag...
[cycript.git] / Network.cpp
1 #include "cycript.hpp"
2
3 #include <sys/types.h>
4 #include <sys/socket.h>
5
6 bool CYRecvAll_(int socket, uint8_t *data, size_t size) {
7 while (size != 0) if (size_t writ = _syscall(recv(socket, data, size, 0))) {
8 data += writ;
9 size -= writ;
10 } else
11 return false;
12 return true;
13 }
14
15 bool CYSendAll_(int socket, const uint8_t *data, size_t size) {
16 while (size != 0) if (size_t writ = _syscall(send(socket, data, size, 0))) {
17 data += writ;
18 size -= writ;
19 } else
20 return false;
21 return true;
22 }