Sha256: 566964d9d2ee8160d1a773fdac0760a240571db157ba18b77bce1d70f9f4140c

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include "socket.h"
#include "byte.h"

int socket_send(int fd,const unsigned char *x,long long xlen,const unsigned char *ip,const unsigned char *port)
{
  struct sockaddr_in sa;

  if (xlen < 0 || xlen > 1048576) { errno = EPROTO; return -1; }

  byte_zero(&sa,sizeof sa);
  sa.sin_family = AF_INET;
  byte_copy(&sa.sin_addr,4,ip);
  byte_copy(&sa.sin_port,2,port);
  return sendto(fd,x,xlen,0,(struct sockaddr *) &sa,sizeof sa);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_nacl-0.1.2 ext/ruby_nacl/NaCl/curvecp/socket_send.c
ruby_nacl-0.1.1 ext/ruby_nacl/NaCl/curvecp/socket_send.c
ruby_nacl-0.1.0 ext/ruby_nacl/NaCl/curvecp/socket_send.c