// Send implements transport.ConnectedEndpoint.Send.
Send implements transport.ConnectedEndpoint.Send.
// Send implements transport . ConnectedEndpoint . Send .
func (c *ConnectedEndpoint) Send(ctx context.Context, data [][]byte, controlMessages transport.ControlMessages, from tcpip.FullAddress) (int64, bool, *syserr.Error) {
	c.mu.RLock()
	defer c.mu.RUnlock()
	if !controlMessages.Empty() {
		return 0, false, syserr.ErrInvalidEndpointState
	}
	truncate := c.stype == linux.SOCK_STREAM
	n, totalLen, err := fdWriteVec(c.fd, data, c.SendMaxQueueSize(), truncate)
	if n < totalLen && err == nil {
		err = syserror.EAGAIN
	}
	if n > 0 && err != syserror.EAGAIN {
		err = nil
	}
	return n, false, syserr.FromError(err)
}
func ( c * ConnectedEndpoint ) Send ( ctx context . Context , data [ ] [ ] byte , controlMessages transport . ControlMessages , from tcpip . FullAddress ) ( int64 , bool , * syserr . Error ) { c . mu . RLock ( ) defer c . mu . RUnlock ( ) if ! controlMessages . Empty ( ) { return 0 , false , syserr . ErrInvalidEndpointState } truncate := c . stype == linux . SOCK_STREAM n , totalLen , err := fdWriteVec ( c . fd , data , c . SendMaxQueueSize ( ) , truncate ) if n < totalLen && err == nil { err = syserror . EAGAIN } if n > 0 && err != syserror . EAGAIN { err = nil } return n , false , syserr . FromError ( err ) }
Send implements transport.ConnectedEndpoint.Send.
Send implements transport . ConnectedEndpoint . Send .
// Since stream sockets don't preserve message boundaries, we can write // only as much of the message as fits in the send buffer. // The host only returns a short write if it would otherwise // block (and only for stream sockets). // The caller may need to block to send more data, but // otherwise there isn't anything that can be done about an // error with a partial write. // There is no need for the callee to call SendNotify because fdWriteVec // uses the host's sendmsg(2) and the host kernel's queue.