/*
- * $Id: comm.cc,v 1.197 1997/10/26 06:26:25 wessels Exp $
+ * $Id: comm.cc,v 1.198 1997/10/27 21:58:48 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
#endif
}
-
-/* Send a udp datagram to specified PORT at HOST. */
-int
-comm_udp_send(int fd, const char *host, u_short port, const char *buf, int len)
-{
- const ipcache_addrs *ia = NULL;
- static struct sockaddr_in to_addr;
- int bytes_sent;
-
- /* Set up the destination socket address for message to send to. */
- to_addr.sin_family = AF_INET;
-
- if ((ia = ipcache_gethostbyname(host, IP_BLOCKING_LOOKUP)) == 0) {
- debug(50, 1) ("comm_udp_send: gethostbyname failure: %s: %s\n",
- host, xstrerror());
- return (COMM_ERROR);
- }
- to_addr.sin_addr = ia->in_addrs[ia->cur];
- to_addr.sin_port = htons(port);
- if ((bytes_sent = sendto(fd, buf, len, 0, (struct sockaddr *) &to_addr,
- sizeof(to_addr))) < 0) {
- debug(50, 1) ("comm_udp_send: sendto failure: FD %d: %s\n",
- fd, xstrerror());
- return COMM_ERROR;
- }
- return bytes_sent;
-}
-
/* Send a udp datagram to specified TO_ADDR. */
int
comm_udp_sendto(int fd,
extern void commSetSelect(int, unsigned int, PF *, void *, time_t);
extern void comm_add_close_handler(int fd, PF *, void *);
extern void comm_remove_close_handler(int fd, PF *, void *);
-extern int comm_udp_send(int fd, const char *host, u_short port, const char *buf, int len);
extern int comm_udp_sendto(int fd, const struct sockaddr_in *, int size, const char *buf, int len);
extern void comm_write(int fd,
char *buf,