Separate structure for per-endpoint options

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Fix two race conditions in sinproc (fixes #114)

Includes (slighly modified) disconnction fix by David Beck (#164)

Signed-off-by: Paul Colomiets <paul@colomiets.name>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Devid Beck added to the AUTHORS file.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Implement resending request immediately after connection failure (#87)

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Fix race condition between closing usock and removing pipe

Added USOCK_SHUTDOWN event at which sent to owner, makes owner to stop the pipe and nn_sock_rm() it.

This patch is relies very much on the internals of the event processing in nn_ctx_leave() to deliver USOCK_SHUTDOWN before executing task_stop. If you're not ok with that, I can fix it, but it probably means I must add another state in every object that just ignores USOCK_SHUTDOWN event now.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Refactored sinproc shutdown code (fixes #31)

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
changed nn_chunk_addref parameter n from type int to more consistent type uint32_t

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Return ENOMEM from nn_allocmsg (fixes #175)

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
protocol.h and transport.h files are not installed

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
FreeBSD can return ECONNRESET from close()

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
sendmsg on FreeBSD can return ENOTCONN

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Update nn.h

copy paste issue from socket.h

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Emeric Chevalier added to AUTHORS file.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Premature deallocation of message in SURVEYOR fixed

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Fix warning for adding integer to string.

Clang warns on this construct and suggests using array indexing
to silence the warning.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
On Windows errno codes are translated to err strings by nanomsg rather than strerror

It seems that strerror() on Windows isn't able to convert
all error code (EISCONN in particular).

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
All error codes are reported via nn_symbol() unconditionally

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Handle EISCONN error produced by nn_excl decently

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
tests for rejected connections added

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Two small bugs fixed in nanocat

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>