sendwaves.3
来自「speech signal process tools」· 3 代码 · 共 126 行
3
126 行
.\" Copyright (c) 1991, Entropic Research Lab, Inc..\" @(#)sendwaves.3 1.3 06 Jun 1995 ERL.TH "SEND_XWAVES" 3\-ESPSu 06 Jun 1995.ds ]W "\fI\s+4\ze\h'0.05'e\s-4\v'-0.4m'\fP\(*p\v'0.4m'\ Entropic Speech, Inc..SH "NAME"open_xwaves \- open a socket connection to an \fIxwaves+\fR server.brsend_xwaves \- send a command to an \fIxwaves+\fR server.brclose_xwaves \- close a socket connection to an \fIxwaves+\fR server.brsend_xwaves2 \- send a single command to an \fIxwaves+\fR server without a separate open and close.SH "SYNOPSIS".ft B#include <esps/esps.h>#include <esps/ss.h>.sp.nfSOCKET *open_xwaves(host, port, verbose)char *host;int port, verbose;.spintsend_xwaves(sp, str)SOCKET *sp;char *str;.spvoidclose_xwaves(sp)SOCKET *sp;.spintsend_xwaves2(host, port, str, verbose)open_xwaves(host, port, verbose)char *host, *str;int port, verbose;.fi.ft R.sp.SH "DESCRIPTION".PPThese functions are used to communicate with an \fIxwaves+\fR programrunning in server mode. For more details on this mode of \fIxwaves+\fRsee \fIxwaves+\fR\(\-1\s-1ESPS\s+1)..PPThe functions \fIopen_xwaves\fR, \fIsend_xwaves\fR, and\fIclose_xwaves\fR are used in cases where a program is going to sendmore than one command to an \fIxwaves+\fR server. In this case, asocket connection is maintained open, so that an arbitrary number ofcommands can be sent over it. When the connection is no longer needed,it is closed..PPThe function \fIsend_xwaves2\fR is used in cases where only a singlecommand is going to be sent. It combines the open and close functioninto a single call. It should not be used to send a large number ofcommands, however, due to the overhead of opening and closing theconnection..PP.I open_xwavesattempts to open a socket connection to an \fIxwaves+\fR server. If\fIhost\fR is non-NULL, then the connection is attempted on the machinewith the hostname of \fIhost\fR. If \fIhost\fR is NULL and theenvironment variable \fBWAVES_HOST\fR is defined, then the connection isattempted to a server on the hostname specified by \fBWAVES_HOST\fR.If \fBWAVES_HOST\fR is not defined, then the connection is attempted toa server on the same has as is running this function (i.e.\fIlocalhost\fR). If \fIport\fR is non-zero, then its value is used asthe socket port for the connection attempt. If \fIport\fR is zero andthe environment variable \fBWAVES_PORT\fR is defined, then the portspecified in \fBWAVES_PORT\fR is used for the attempt. If\fBWAVES_PORT\fR is not defined then an ESPS default value (given in\fIesps.h\fR is used instead). If \fIverbose\fR is non-zero, thena message is printed if the connection cannot be opened, mentioning thehostname and port number. If \fIverbose\fR is zero, no message isprinted and only a status value is returned. The return value of thefunction is the SOCKET pointer value for success and NULL for failure..PP.I send_xwavessends a command to an \fIxwaves+\fR running in server mode. The valuefor \fIsp\fR must be a socket pointer previously returned by\fIopen_xwaves\fR. \fIstr\fR is a pointer to the command to send andmust be non-NULL and terminated with a newline character. The function returns zero for success and -1 forfailure to communicate..PP.I close_xwavescloses an existing socket connection to an \fIxwaves+\fR server. Thevalue of \fIsp\fR is a socket pointer to a previously opened\fIxwaves+\fR server..PP.I send_xwaves2combines the above functions into a single function, to open a serverconnection, send a command, and then close a connection. This isconvienent when only a single command is being sent. The arguments\fIhost\fR, \fIport\fR, \fIstr\fR, and \fIverbose\fR have the same meaning as with the above functions. \fIstr\fR is a pointer to the command to send and must be non-NULL and terminated with anewline character. .SH "EXAMPLE".nf\fI/* Open a connection */\fRSOCKET *sp;char buffer[100];sp = open_xwaves(host, port, 1);if (sp == NULL) \fIerror...\fRsprintf(buffer,"make file %s\n",filename);if (send_xwaves(sp, buffer) == -1) \fIerror...\fRclose_xwaves(sp);.fi.SH DIAGNOSTICS.PPAn assertion failure occurs if \fIstr\fR or \fIsp\fR is NULL..SH "SEE ALSO".PPsend_xwaves(1\-\s-1ESPS\s+1), waves_show_sd(3-ESPS).SH "AUTHOR".PPAlan Parker, based upon the Simple Socket Library by Mat Watson andHubert Bartels. Used with permission.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?