Commit graph

250 commits

Author SHA1 Message Date
LemonBoy
81e5a35d56 Show correct address for ipv6 sockets, fixes #7634 (#10505) 2019-01-31 07:34:26 +01:00
Federico Ceratto
095eaacf21 Fix spelling errors (#10379) 2019-01-19 16:01:27 +01:00
Miran
214f48eae9
Remove long deprecated stuff (#10332) 2019-01-18 07:18:32 +01:00
Dominik Picheta
76c214a2e9
Merge pull request #9915 from zevv/asyncnet-unix
Added basic AF_UNIX support to asyncnet.
2018-12-12 23:06:08 +00:00
Ico Doornekamp
71e9fff364 Added basic AF_UNIX support to asyncnet.
Unfortunately this required some code duplication because the
doConnect() from asynccommon.nim only works with addrInfo which does not
make sense for AF_UNIX.

makeUnixAddr() was moved to nativesocket.nim and exported
2018-12-09 20:53:05 +01:00
Andreas Rumpf
223e92b83a stdlib: documenation updates, the exception names have been changed 2018-10-25 07:42:45 +02:00
LemonBoy
a27429304e Convert *_family fields to cushort
Fixes #9008
2018-09-19 12:33:11 +02:00
LemonBoy
a2a06d43f2 Fix connectUnix/bindUnix with abstract socket paths
The only way to make this work for both abstract and non-abstract
sockets is to send the kernel an incomplete structure.

Reported by Epictek on the forum.
2018-09-15 20:43:08 +02:00
Dominik Picheta
6e83746caa Net module fixes (#8597)
* net.accept no longer needs an initialised socket. Fixes #7848.
* Assert error when using sendTo/recvFrom on TCP socket.
* net.sendTo now raises OSError.
2018-08-28 15:52:28 +02:00
Andreas Rumpf
dae5450947 WIP: disallow 'nil' for strings and seqs 2018-08-13 11:41:33 +02:00
Euan T
e11d52a4e8
Update example code for UDP sockets 2018-07-30 13:39:32 +01:00
Yuriy Glukhov
b2323de914 Fixed compilation error when Sockaddr_in4 or Sockaddr_in6 passed to fromSockAddr 2018-06-07 21:10:00 +03:00
cheatfate
2902308a05 Fix one more place. 2018-06-07 13:06:06 +03:00
cheatfate
46a6fa53a9 Fix fromSockAddrAux() to handle IPv6 addresses properly. 2018-06-07 12:33:29 +03:00
Andreas Rumpf
e67eddc91b
Merge pull request #7822 from data-man/fix_2753
Fixes #2753
2018-06-07 10:40:50 +02:00
WhiteDuke
b36c499907
Set domain to client 2018-05-27 21:08:37 +02:00
data-man
5e8faaf710 Fixes #2753 2018-05-14 19:13:11 +03:00
Mathias Stearn
9048bcc54b Add connectUnix and bindUnix to net docs
fixes #7715
2018-05-09 17:42:16 +02:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
David Krause
78e946c450 fixed high level sendTo for sending to udp6 (#7630) 2018-05-02 22:44:08 +01:00
Jacek Sieka
72dfe176f5 remove dead code elimination option (#7669) 2018-04-23 11:02:38 +02:00
Dominik Picheta
39c71d6211
Merge pull request #7336 from yglukhov/ipaddr-sockaddr-conversions
Conversion procs for (IpAddress, Port) <-> (SockAddr, Socklen)
2018-04-02 14:31:05 +01:00
Graham Fawcett
ace96bf83e net.connect (with timeout), raise error on connect failure
Under Linux (probably POSIX), the current code tests for timeout, but
does not test for connection failure. connectAsync() returns succesfully
upon an EINPROGRESS result; but at this point, the connection state is
still unknown. After selectWrite() is done, we need to test the socket
for errors again.
2018-03-28 19:09:16 -04:00
Yuriy Glukhov
0770844285 Comments addressed 2018-03-24 22:55:06 +02:00
Yuriy Glukhov
b52de1fcee More flexible fromSockAddr interface 2018-03-15 17:39:09 +02:00
Yuriy Glukhov
1bd0efb067 Fixed crash/interface. Added tests. 2018-03-15 15:49:41 +02:00
Yuriy Glukhov
29bb10b185 Convertion procs for (IpAddress, Port) <-> (SockAddr, Socklen) 2018-03-14 23:14:31 +02:00
Dominik Picheta
1975998c56 Detect openssl related to outdated openssl and help user solve issue. 2018-02-25 13:34:32 +00:00
Dominik Picheta
63bc046ddf Fixes #7227. 2018-02-17 19:36:06 +00:00
Dominik Picheta
1a2351f95f Fixes #4995. (#7157) 2018-02-13 11:08:37 +01:00
Dominik Picheta
47d05b3f2e Merge branch 'devel' into async-improvements 2018-01-17 16:28:00 +00:00
Dominik Picheta
1661062ebf Raise assertion error when attempting to use closed socket. 2018-01-15 17:48:32 +00:00
Dominik Picheta
4181e1940d recv with a timeout of -1 shouldn't wait on all data. 2018-01-11 20:46:44 +00:00
Dominik Picheta
1256f211f5
Merge pull request #6922 from FedericoCeratto/openssl-1.1.0
Add OpenSSL 1.1.0 support
2018-01-10 23:05:42 +00:00
Andreas Rumpf
08af53032b net.nim: minor documentation update 2018-01-07 12:20:00 +01:00
Federico Ceratto
a78d7a31f7 Add OpenSSL 1.1.0 support #5000
Add a simple online test
2017-12-28 21:57:43 +00:00
Andreas Rumpf
5e43e0d789
Merge branch 'devel' into async-improvements 2017-12-11 15:12:45 +01:00
Federico Ceratto
83de3a85e7 Add TCP_NODELAY support #6795 2017-11-24 23:01:18 +00:00
Dominik Picheta
e5a27c96fb Implements nativesockets.accept. 2017-11-24 16:29:34 +00:00
Dominik Picheta
f221c192b3
Fix creating server example in net module 2017-11-07 17:23:53 +00:00
Yuriy Glukhov
d7b96f478b Fixed crash in case of ssl error in SSLShutdown (#6662) 2017-11-01 10:16:44 +01:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Ruslan Mustakov
e0059287bb Add 'hostname' param to wrapConnectedSocket 2017-05-04 16:27:08 +07:00
Ruslan Mustakov
ecf278c467 Implement dial, support IPv6 in httpclient (#5763)
* Implement dial, support IPv6 in httpclient

Added ``dial`` procedure to networking modules: ``net``, ``asyncdispatch``,
``asyncnet``. It merges socket creation, address resolution, and connection
into single step. When using ``dial``, you don't have to worry about
IPv4 vs IPv6 problem.

Fixed addrInfo loop in connect to behave properly.
Previously it would stop on first non-immediate failure, instead of
continuing and trying the remaining addresses.

Fixed newAsyncNativeSocket to raise proper error if socket creation
fails.

Fixes: #3811

* Check domain during connect() only on non-Windows

This is how it was in the previous implementation of connect().

* Call 'osLastError' before 'close' in net.dial

* Record osLastError before freeAddrInfo in net.dial

* Add missing docs for 'dial' proc

* Optimize dial to create one FD per domain, add tests

And make async IPv6 servers work on Windows.

* Add IPv6 test to uri module

* Fix getAddrString error handling
2017-05-02 09:25:50 +02:00
Andreas Rumpf
159643824b fixes #3847 (#5609) 2017-03-27 09:39:46 +02:00
Andreas Rumpf
76eb20d2d3 deprecated nativesockets.dealloc, use freeAddrInfo instead; fixed stdlib deprecations 2017-01-30 08:50:57 +01:00
Yuriy Glukhov
a80a0972b7 Fixed dynlink with OpenSSL >1.1.0. Added loadLibPattern. 2016-11-30 17:16:54 +02:00
David Krause
5058ae1ba5 fixed typo 2016-11-17 16:47:36 +01:00
Yuriy Glukhov
6690cd15f4 Mark socketError as gcsafe 2016-10-26 20:17:40 +03:00
Dominik Picheta
8a6343b5b6 Fixes #3847. 2016-09-25 13:02:10 +02:00