/[monit]/monit/net.h
ViewVC logotype

Diff of /monit/net.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by hauk, Fri Aug 1 01:10:59 2003 UTC revision 1.17 by hauk, Mon Aug 4 07:52:12 2003 UTC
# Line 38  Line 38 
38    
39    
40  /**  /**
41     * Standard seconds to wait for a socket connection or for socket read
42     * i/o before aborting
43     */
44    #define NET_TIMEOUT 5
45    
46    
47    /**
48   * Test INET Socket connection to host on port with the specified   * Test INET Socket connection to host on port with the specified
49   * socket protocol type. The protocol should be either SOCK_STREAM or   * socket protocol type. The protocol should be either SOCK_STREAM or
50   * SOCK_DGRAM.   * SOCK_DGRAM.
# Line 86  int check_udp_socket(int socket); Line 93  int check_udp_socket(int socket);
93   * @param hostname The host to open a socket at   * @param hostname The host to open a socket at
94   * @param port The port number to connect to   * @param port The port number to connect to
95   * @param protocol Socket protocol to use (SOCK_STREAM|SOCK_DGRAM)   * @param protocol Socket protocol to use (SOCK_STREAM|SOCK_DGRAM)
96     * @param timeout If not connected within timeout seconds abort and return -1
97   * @return The socket or -1 if an error occured.   * @return The socket or -1 if an error occured.
98   */   */
99  int create_socket(char *hostname, int port, int protocol);  int create_socket(char *hostname, int port, int protocol, int timeout);
100    
101    
102  /**  /**
# Line 103  int create_generic_socket(Port_T p); Line 111  int create_generic_socket(Port_T p);
111  /**  /**
112   * Create a non-blocking UNIX socket.   * Create a non-blocking UNIX socket.
113   * @param pathname The pathname to use for the unix socket   * @param pathname The pathname to use for the unix socket
114     * @param timeout If not connected within timeout seconds abort and return -1
115   * @return The socket or -1 if an error occured.   * @return The socket or -1 if an error occured.
116   */   */
117  int create_unix_socket(char *pathname);  int create_unix_socket(char *pathname, int timeout);
118    
119    
120  /**  /**
# Line 173  int can_write(int socket, int timeout); Line 182  int can_write(int socket, int timeout);
182   * @param socket the socket to write to   * @param socket the socket to write to
183   * @param buffer The buffer to write   * @param buffer The buffer to write
184   * @param size Number of bytes to send   * @param size Number of bytes to send
185   * @return The number of bytes sent or -1 if an error   * @return The number of bytes sent or -1 if an error occured.
  * occured. Returning 0 means EOF  
186   */   */
187  int sock_write(int socket, void *buffer, int size);  int sock_write(int socket, void *buffer, int size);
188    
# Line 187  int sock_write(int socket, void *buffer, Line 195  int sock_write(int socket, void *buffer,
195   * @param buffer The buffer to write the data to   * @param buffer The buffer to write the data to
196   * @param size Number of bytes to read from the socket   * @param size Number of bytes to read from the socket
197   * @param timeout Seconds to wait for data to be available   * @param timeout Seconds to wait for data to be available
198   * @return The number of bytes read or -1 if an error   * @return The number of bytes read or -1 if an error occured.
  * occured. Returning 0 means EOF  
199  */  */
200  int sock_read(int socket, void *buffer, int size, int timeout);  int sock_read(int socket, void *buffer, int size, int timeout);
201    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26