diff options
Diffstat (limited to 'core/Lossless_UDP.h')
-rw-r--r-- | core/Lossless_UDP.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/core/Lossless_UDP.h b/core/Lossless_UDP.h index 53afe606..bd426ee0 100644 --- a/core/Lossless_UDP.h +++ b/core/Lossless_UDP.h | |||
@@ -33,7 +33,7 @@ extern "C" { | |||
33 | /* maximum length of the data in the data packets */ | 33 | /* maximum length of the data in the data packets */ |
34 | #define MAX_DATA_SIZE 1024 | 34 | #define MAX_DATA_SIZE 1024 |
35 | 35 | ||
36 | /* | 36 | /* |
37 | * Initialize a new connection to ip_port | 37 | * Initialize a new connection to ip_port |
38 | * Returns an integer corresponding to the connection id. | 38 | * Returns an integer corresponding to the connection id. |
39 | * Return -1 if it could not initialize the connection. | 39 | * Return -1 if it could not initialize the connection. |
@@ -41,51 +41,51 @@ extern "C" { | |||
41 | */ | 41 | */ |
42 | int new_connection(IP_Port ip_port); | 42 | int new_connection(IP_Port ip_port); |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * Get connection id from IP_Port. | 45 | * Get connection id from IP_Port. |
46 | * Return -1 if there are no connections like we are looking for. | 46 | * Return -1 if there are no connections like we are looking for. |
47 | * Return id if it found it . | 47 | * Return id if it found it . |
48 | */ | 48 | */ |
49 | int getconnection_id(IP_Port ip_port); | 49 | int getconnection_id(IP_Port ip_port); |
50 | 50 | ||
51 | /* | 51 | /* |
52 | * Returns an int corresponding to the next connection in our imcoming connection list | 52 | * Returns an int corresponding to the next connection in our imcoming connection list |
53 | * Return -1 if there are no new incoming connections in the list. | 53 | * Return -1 if there are no new incoming connections in the list. |
54 | */ | 54 | */ |
55 | int incoming_connection(void); | 55 | int incoming_connection(void); |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * Return -1 if it could not kill the connection. | 58 | * Return -1 if it could not kill the connection. |
59 | * Return 0 if killed successfully | 59 | * Return 0 if killed successfully |
60 | */ | 60 | */ |
61 | int kill_connection(int connection_id); | 61 | int kill_connection(int connection_id); |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * Kill connection in seconds seconds. | 64 | * Kill connection in seconds seconds. |
65 | * Return -1 if it can not kill the connection. | 65 | * Return -1 if it can not kill the connection. |
66 | * Return 0 if it will kill it | 66 | * Return 0 if it will kill it |
67 | */ | 67 | */ |
68 | int kill_connection_in(int connection_id, uint32_t seconds); | 68 | int kill_connection_in(int connection_id, uint32_t seconds); |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * Returns the ip_port of the corresponding connection. | 71 | * Returns the ip_port of the corresponding connection. |
72 | * Return 0 if there is no such connection. | 72 | * Return 0 if there is no such connection. |
73 | */ | 73 | */ |
74 | IP_Port connection_ip(int connection_id); | 74 | IP_Port connection_ip(int connection_id); |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * Returns the id of the next packet in the queue | 77 | * Returns the id of the next packet in the queue |
78 | * Return -1 if no packet in queue | 78 | * Return -1 if no packet in queue |
79 | */ | 79 | */ |
80 | char id_packet(int connection_id); | 80 | char id_packet(int connection_id); |
81 | 81 | ||
82 | /* | 82 | /* |
83 | * Return 0 if there is no received data in the buffer. | 83 | * Return 0 if there is no received data in the buffer. |
84 | * Return length of received packet if successful | 84 | * Return length of received packet if successful |
85 | */ | 85 | */ |
86 | int read_packet(int connection_id, uint8_t *data); | 86 | int read_packet(int connection_id, uint8_t *data); |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * Return 0 if data could not be put in packet queue | 89 | * Return 0 if data could not be put in packet queue |
90 | * Return 1 if data was put into the queue | 90 | * Return 1 if data was put into the queue |
91 | */ | 91 | */ |
@@ -94,8 +94,8 @@ int write_packet(int connection_id, uint8_t *data, uint32_t length); | |||
94 | /* Returns the number of packets in the queue waiting to be successfully sent. */ | 94 | /* Returns the number of packets in the queue waiting to be successfully sent. */ |
95 | uint32_t sendqueue(int connection_id); | 95 | uint32_t sendqueue(int connection_id); |
96 | 96 | ||
97 | /* | 97 | /* |
98 | * returns the number of packets in the queue waiting to be successfully | 98 | * returns the number of packets in the queue waiting to be successfully |
99 | * read with read_packet(...) | 99 | * read with read_packet(...) |
100 | */ | 100 | */ |
101 | uint32_t recvqueue(int connection_id); | 101 | uint32_t recvqueue(int connection_id); |
@@ -112,7 +112,7 @@ int is_connected(int connection_id); | |||
112 | /* Call this function a couple times per second It's the main loop. */ | 112 | /* Call this function a couple times per second It's the main loop. */ |
113 | void doLossless_UDP(void); | 113 | void doLossless_UDP(void); |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * This function sets up LosslessUDP packet handling. | 116 | * This function sets up LosslessUDP packet handling. |
117 | */ | 117 | */ |
118 | void LosslessUDP_init(void); | 118 | void LosslessUDP_init(void); |