Skip to content

BenGoldberg1/p5-UV

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

UV - Perl interface to libuv

SYNOPSIS

#!/usr/bin/env perl
use strict;
use warnings;

use UV;

# hi-resolution time
my $hi_res_time = UV::hrtime();

# A new loop
my $loop = UV::Loop->new();

# default loop
my $loop = UV::Loop->default_loop(); # convenience constructor
my $loop = UV::Loop->new(1); # Tell the constructor you want the default loop

# run a loop with one of three options:
# UV_RUN_DEFAULT, UV_RUN_ONCE, UV_RUN_NOWAIT
$loop->run(); # runs with UV_RUN_DEFAULT
$loop->run(UV::Loop::UV_RUN_DEFAULT); # explicitly state UV_RUN_DEFAULT
$loop->run(UV::Loop::UV_RUN_ONCE);
$loop->run(UV::Loop::UV_RUN_NOWAIT);

DESCRIPTION

This module provides an interface to libuv. We will try to document things here as best as we can, but we also suggest you look at the libuv docs directly for more details on how things work.

Event loops that work properly on all platforms. YAY!

CONSTANTS

ERROR CONSTANTS

UV_E2BIG

Argument list too long

UV_EACCES

Permission denied

UV_EADDRINUSE

Address already in use

UV_EADDRNOTAVAIL

Address not available

UV_EAFNOSUPPORT

Address family not supported

UV_EAGAIN

Resource temporarily unavailable

UV_EAI_ADDRFAMILY

Address family not supported

UV_EAI_AGAIN

Temporary failure

UV_EAI_BADFLAGS

Bad ai_flags value

UV_EAI_BADHINTS

Invalid value for hints

UV_EAI_CANCELED

Request canceled

UV_EAI_FAIL

Permanent failure

UV_EAI_FAMILY

ai_family not supported

UV_EAI_MEMORY

Out of memory

UV_EAI_NODATA

No address

UV_EAI_NONAME

Unknown node or service

UV_EAI_OVERFLOW

Argument buffer overflow

UV_EAI_PROTOCOL

Resolved protocol is unknown

UV_EAI_SERVICE

Service not available for socket type

UV_EAI_SOCKTYPE

Socket type not supported

UV_EALREADY

Connection already in progress

UV_EBADF

Bad file descriptor

UV_EBUSY

Resource busy or locked

UV_ECANCELED

Operation canceled

UV_ECHARSET

Invalid Unicode character

UV_ECONNABORTED

Software caused connection abort

UV_ECONNREFUSED

Connection refused

UV_ECONNRESET

Connection reset by peer

UV_EDESTADDRREQ

Destination address required

UV_EEXIST

File already exists

UV_EFAULT

Bad address in system call argument

UV_EFBIG

File too large

UV_EHOSTUNREACH

Host is unreachable

UV_EINTR

Interrupted system call

UV_EINVAL

Invalid argument

UV_EIO

i/o error

UV_EISCONN

Socket is already connected

UV_EISDIR

Illegal operation on a directory

UV_ELOOP

Too many symbolic links encountered

UV_EMFILE

Too many open files

UV_EMLINK

Too many links

UV_EMSGSIZE

Message too long

UV_ENAMETOOLONG

Name too long

UV_ENETDOWN

Network is down

UV_ENETUNREACH

Network is unreachable

UV_ENFILE

File table overflow

UV_ENOBUFS

No buffer space available

UV_ENODEV

No such device

UV_ENOENT

No such file or directory

UV_ENOMEM

Not enough memory

UV_ENONET

Machine is not on the network

UV_ENOPROTOOPT

Protocol not available

UV_ENOSPC

No space left on device

UV_ENOSYS

Function not implemented

UV_ENOTCONN

Socket is not connected

UV_ENOTDIR

Not a directory

UV_ENOTEMPTY

Directory not empty

UV_ENOTSOCK

Socket operation on non-socket

UV_ENOTSUP

Operation not supported on socket

UV_ENXIO

No such device or address

UV_EOF

End of file

UV_EPERM

Operation not permitted

UV_EPIPE

Broken pipe

UV_EPROTO

Protocol error

UV_EPROTONOSUPPORT

Protocol not supported

UV_EPROTOTYPE

Protocol wrong type for socket

UV_ERANGE

Result too large

UV_EROFS

Read-only file system

UV_ESHUTDOWN

Cannot send after transport endpoint shutdown

UV_ESPIPE

Invalid seek

UV_ESRCH

No such process

UV_ETIMEDOUT

Connection timed out

UV_ETXTBSY

Text file is busy

UV_EXDEV

Cross-device link not permitted

UV_UNKNOWN

Unknown error

REQUEST TYPE CONSTANTS

UV_CONNECT

UV_FS

UV_GETADDRINFO

UV_GETNAMEINFO

UV_REQ

UV_SHUTDOWN

UV_UDP_SEND

UV_WORK

UV_WRITE

HANDLE TYPE CONSTANTS

UV_ASYNC

UV_CHECK

UV_FILE

UV_FS_EVENT

UV_FS_POLL

UV_HANDLE

UV_IDLE

UV_NAMED_PIPE

UV_POLL

UV_PREPARE

UV_PROCESS

UV_SIGNAL

UV_STREAM

UV_TCP

UV_TIMER

UV_TTY

UV_UDP

FUNCTIONS

The following functions are available:

default_loop

my $loop = UV::default_loop();
# You can also get it with the UV::Loop methods below:
my $loop = UV::Loop->default_loop();
my $loop = UV::Loop->default();
# Passing a true value as the first arg to the UV::Loop constructor
# will also return the default loop
my $loop = UV::Loop->new(1);

Returns the default loop (which is a singleton object). This module already creates the default loop and you get access to it with this method.

hrtime

my $uint64_t = UV::hrtime();

Get the current Hi-Res time (uint64_t).

AUTHOR

Daisuke Murase <[email protected]>

CONTRIBUTORS

Chase Whitener <[email protected]>

COPYRIGHT AND LICENSE

Copyright 2012, Daisuke Murase.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

About

libUV bindings in Perl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 82.7%
  • Perl 8.2%
  • XS 7.2%
  • C 1.9%