171 |
* @param socket the socket to write to |
* @param socket the socket to write to |
172 |
* @param buffer The buffer to write |
* @param buffer The buffer to write |
173 |
* @param size Number of bytes to send |
* @param size Number of bytes to send |
174 |
|
* @param timeout Seconds to wait for data to be written |
175 |
* @return The number of bytes sent or -1 if an error occured. |
* @return The number of bytes sent or -1 if an error occured. |
176 |
*/ |
*/ |
177 |
int sock_write(int socket, const void *buffer, int size); |
int sock_write(int socket, const void *buffer, int size, int timeout); |
178 |
|
|
179 |
|
|
180 |
/** |
/** |
181 |
* Read up to size bytes from the <code>socket</code> into the |
* Read up to size bytes from the <code>socket</code> into the |
189 |
*/ |
*/ |
190 |
int sock_read(int socket, void *buffer, int size, int timeout); |
int sock_read(int socket, void *buffer, int size, int timeout); |
191 |
|
|
192 |
|
|
193 |
|
/** |
194 |
|
* Write <code>size</code> bytes from the <code>buffer</code> to the |
195 |
|
* <code>socket</code>. The given socket <b>must</b> be a connected |
196 |
|
* UDP socket |
197 |
|
* @param socket the socket to write to |
198 |
|
* @param buffer The buffer to write |
199 |
|
* @param size Number of bytes to send |
200 |
|
* @param timeout Seconds to wait for data to be written |
201 |
|
* @return The number of bytes sent or -1 if an error occured. |
202 |
|
*/ |
203 |
|
int udp_write(int socket, void *b, int len, int timeout); |
204 |
|
|
205 |
|
|
206 |
/** |
/** |
207 |
* Create a ICMP socket against hostname, send echo and wait for response. |
* Create a ICMP socket against hostname, send echo and wait for response. |
208 |
* The 'count' echo requests is send and we expect at least one reply. |
* The 'count' echo requests is send and we expect at least one reply. |