Mercurial > hg > beaglert
comparison include/UdpServer.h @ 126:719119fb2905 scope-refactoring
Closing socket in the destructor
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 24 Aug 2015 15:25:34 +0100 |
parents | 2197435e8fb4 |
children | ff28e56e5b7e |
comparison
equal
deleted
inserted
replaced
125:850a4a9bd832 | 126:719119fb2905 |
---|---|
10 | 10 |
11 #include <sys/types.h> | 11 #include <sys/types.h> |
12 #include <sys/socket.h> | 12 #include <sys/socket.h> |
13 #include <netinet/in.h> | 13 #include <netinet/in.h> |
14 #include <arpa/inet.h> | 14 #include <arpa/inet.h> |
15 #include <errno.h> | |
15 #include <netdb.h> | 16 #include <netdb.h> |
16 #include <stdio.h> | 17 #include <stdio.h> |
17 #include <stdlib.h> | 18 #include <stdlib.h> |
18 #include <unistd.h> | 19 #include <unistd.h> |
19 #include <string.h> | 20 #include <string.h> |
48 If blockUntilSpecifiedAmountHasArrived is true, the method will block until maxBytesToRead | 49 If blockUntilSpecifiedAmountHasArrived is true, the method will block until maxBytesToRead |
49 bytes have been read, (or until an error occurs). If this flag is false, the method will | 50 bytes have been read, (or until an error occurs). If this flag is false, the method will |
50 return as much data as is currently available without blocking. | 51 return as much data as is currently available without blocking. |
51 */ | 52 */ |
52 int read(void* destBuffer, int maxBytesToRead, bool blockUntilSpecifiedAmountHasArrived); | 53 int read(void* destBuffer, int maxBytesToRead, bool blockUntilSpecifiedAmountHasArrived); |
54 void close(); | |
53 int emptySocket(); | 55 int emptySocket(); |
54 int emptySocket(int maxBytes); | 56 int emptySocket(int maxBytes); |
55 void *getWaste(); | 57 void *getWaste(); |
56 /* | 58 /* |
57 * Waits until the socket is ready for reading or writing. | 59 * Waits until the socket is ready for reading or writing. |