~ubuntu-branches/ubuntu/trusty/rgtk2/trusty

« back to all changes in this revision

Viewing changes to man/gSocketSendMessage.Rd

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2010-11-03 11:35:46 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20101103113546-a7fi7jdxdebp0tw1
Tags: 2.20.1-1
* New upstream release

* debian/control: Set (Build-)Depends: to current R version
* debian/control: Set Standards-Version: to current version 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\alias{gSocketSendMessage}
 
2
\name{gSocketSendMessage}
 
3
\title{gSocketSendMessage}
 
4
\description{Send data to \code{address} on \code{socket}.  This is the most complicated and
 
5
fully-featured version of this call. For easier use, see
 
6
\code{\link{gSocketSend}} and \code{\link{gSocketSendTo}}.}
 
7
\usage{gSocketSendMessage(object, address, vectors, messages = NULL, flags = 0, cancellable = NULL, .errwarn = TRUE)}
 
8
\arguments{
 
9
\item{\verb{object}}{a \code{\link{GSocket}}}
 
10
\item{\verb{address}}{a \code{\link{GSocketAddress}}, or \code{NULL}}
 
11
\item{\verb{vectors}}{a list of \verb{GOutputVector} structs}
 
12
\item{\verb{messages}}{a pointer to a list of \verb{GSocketControlMessages}, or
 
13
  \code{NULL}.}
 
14
\item{\verb{flags}}{an int containing \verb{GSocketMsgFlags} flags}
 
15
\item{\verb{cancellable}}{a \code{\link{GCancellable}} or \code{NULL}}
 
16
\item{.errwarn}{Whether to issue a warning on error or fail silently}
 
17
}
 
18
\details{If \code{address} is \code{NULL} then the message is sent to the default receiver
 
19
(set by \code{\link{gSocketConnect}}).
 
20
  \code{vectors} must point to a list of \verb{GOutputVector} structs and
 
21
\code{num.vectors} must be the length of this list. (If \code{num.vectors} is -1,
 
22
then \code{vectors} is assumed to be terminated by a \verb{GOutputVector} with a
 
23
\code{NULL} buffer pointer.) The \verb{GOutputVector} structs describe the buffers
 
24
that the sent data will be gathered from. Using multiple
 
25
\verb{GOutputVector}s is more memory-efficient than manually copying
 
26
data from multiple sources into a single buffer, and more
 
27
network-efficient than making multiple calls to \code{\link{gSocketSend}}.
 
28
  \code{messages}, if non-\code{NULL}, is taken to point to a list of \code{num.messages}\code{\link{GSocketControlMessage}} instances. These correspond to the control
 
29
messages to be sent on the socket.
 
30
If \code{num.messages} is -1 then \code{messages} is treated as a \code{NULL}-terminated
 
31
array.
 
32
  \code{flags} modify how the message is sent. The commonly available arguments
 
33
for this are available in the \verb{GSocketMsgFlags} enum, but the
 
34
values there are the same as the system values, and the flags
 
35
are passed in as-is, so you can pass in system-specific flags too.
 
36
  
 
37
If the socket is in blocking mode the call will block until there is
 
38
space for the data in the socket queue. If there is no space available
 
39
and the socket is in non-blocking mode a \code{G_IO_ERROR_WOULD_BLOCK} error
 
40
will be returned. To be notified when space is available, wait for the
 
41
\code{G_IO_OUT} condition. Note though that you may still receive
 
42
\code{G_IO_ERROR_WOULD_BLOCK} from \code{\link{gSocketSend}} even if you were previously
 
43
notified of a \code{G_IO_OUT} condition. (On Windows in particular, this is
 
44
very common due to the way the underlying APIs work.)
 
45
  
 
46
On error -1 is returned and \code{error} is set accordingly.
 
47
  Since 2.22}
 
48
\value{
 
49
A list containing the following elements:
 
50
\item{retval}{[integer]  Number of bytes written (which may be less than \code{size}), or -1
 
51
on error}
 
52
\item{\verb{error}}{\code{\link{GError}} for error reporting, or \code{NULL} to ignore.}
 
53
}
 
54
\author{Derived by RGtkGen from GTK+ documentation}
 
55
\keyword{internal}