Norman Maurer
58d0883b2d
Fork Future-Swift and adjust it to ensure callback execution is always done on the EventLoop.
...
- Also remove all methods that use Dispatch for now as we not need these
- Ensure we will detect if the user calls a blocking method while on the EventLoop and crash to guard against deadlock
2017-06-12 13:44:10 +02:00
Norman Maurer
c0a2810840
Port AdaptiveRecvByteBufferAllocator from netty and make it the default
2017-06-12 09:13:21 +02:00
Norman Maurer
186dfa70a0
Make FixedSizeRecvByteBufferAllocator a struct
2017-06-11 11:12:16 +02:00
Norman Maurer
34475f3ba4
Only do one buffer allocation per read loop and just make use of the fact that ByteBuffer is a struct and uses COW
2017-06-10 13:31:25 +02:00
Norman Maurer
e3537e162b
Port write buffer mark
2017-06-09 17:58:58 +02:00
Norman Maurer
19ac26e529
Correctly handle reregistrations for kqueue if InterestedEvents were .none before
2017-06-09 20:05:22 +02:00
Norman Maurer
c6685c3e7c
Use types to allow the compile to specialize the methods
2017-06-09 15:47:10 +02:00
Norman Maurer
fce361e337
Tighten up visibility to allow the optimizer doing a better job
2017-06-09 11:16:59 +02:00
Kevin Clark
c9c3651f29
Minor cleanup in byte buffer
2017-06-08 12:05:26 -07:00
Kevin Clark
fc3e0fe384
ByteBuffer bounds checking fixes
...
This fixes a number of bounds checking issues, including changing the behavior of out of bounds access. Now if get is passed a negative value or a value beyond the size of the buffer, it explodes. If set is passed a negative value it also explodes, but values passed the end of the buffer continue to implicitly resize.
2017-06-08 11:51:41 -07:00
Johannes Weiß
12e48ebd4f
TCO in doPendingWriteVectorOperation for Swift 4
2017-06-08 16:44:07 +01:00
Johannes Weiß
2522fa68aa
Swift 3.2 (Swift 4 in Swift 3 mode) needs TCO workaround
2017-06-08 16:10:22 +01:00
Johannes Weiß
02ff223eba
add faster (Static)String write path
2017-06-08 16:09:56 +01:00
Johannes Weiß
37cca97422
rename ByteBuffer.data to ByteBuffer.backingData (to refuse confusion)
2017-06-08 16:09:19 +01:00
Norman Maurer
cd4866152d
No need to allocate and free the iovec array all the time as we can just pin it on the EventLoop
2017-06-08 15:45:48 +02:00
Johannes Weiß
8d9c99b7cc
remove unused and illegal function
2017-06-08 15:14:58 +01:00
Johannes Weiß
d941745bdc
protect already closed sockets
2017-06-08 15:04:59 +01:00
Norman Maurer
12f8e0d6fc
Fix creation of timespec from milliseconds
2017-06-08 14:41:35 +02:00
Norman Maurer
0b78bbf4ed
Not call EventLoop.reregister if the interestedEvents not changed
2017-06-08 13:11:50 +02:00
Norman Maurer
39715425d4
Guard against EBADF when processing write and read spin
2017-06-08 12:52:51 +02:00
Norman Maurer
c0b9c691bb
Correctly return true if the whole buffer is written. This regression was introduced by 9d00cf0191c33eaad5406f04112b318ad848e2c4
2017-06-08 12:15:43 +02:00
Norman Maurer
65aa3f6bbd
Use one EventLoop and adjust some options for the NIOEchoServer
2017-06-07 19:21:13 +02:00
Norman Maurer
aa1f7d04ed
Tighten up API and access rights
2017-06-07 11:15:06 +02:00
Kevin Clark
329b474f45
Initial impl of EmbeddedChannel
2017-06-05 16:59:51 -07:00
Norman Maurer
bec8f64a13
Correctly update readerIndex of ByteBuffer when partial written. Fix regression introduced by 9d00cf0191c33eaad5406f04112b318ad848e2c4
2017-06-07 19:12:05 +02:00
Johannes Weiß
312f6824b5
writev optimisation
2017-06-06 17:26:25 +01:00
Norman Maurer
e8d60df8c2
Make naming more consistent and so make it more swift-like api
2017-06-06 22:06:47 +02:00
Norman Maurer
bff55bbb3d
Port write spin configuration option from netty
2017-06-06 17:13:49 +02:00
Norman Maurer
7d959a3b1a
Not use lazy for perf reasons
2017-06-06 14:51:10 +02:00
Norman Maurer
2114a925aa
Only use gathering write if we really have more then one buffer to write
2017-06-06 12:37:13 +02:00
Norman Maurer
a59302ddbd
Let the error be handled correctly from Channel.readable()
2017-06-06 07:56:16 +02:00
Norman Maurer
d60a62ab80
Better handling of eof
2017-06-06 07:51:40 +02:00
Johannes Weiß
216a74deaf
mini code cleanup
2017-06-05 16:20:00 +01:00
Norman Maurer
f96227a35f
Skip empty buffers when construct array for writev call
2017-06-05 12:59:03 +02:00
Norman Maurer
b03208b527
tighten up access rights
2017-06-02 21:20:27 +02:00
Johannes Weiß
ed3b79d227
port to latest errno wrapper
2017-06-02 19:50:16 +01:00
Johannes Weiß
0fd639fc02
allow the usage of the Data slices API
2017-06-02 12:54:32 +01:00
Johannes Weiß
cd4bb67138
make compatible with Swift 4 compiler (in Swift 3 mode)
2017-06-02 18:25:33 +01:00
Norman Maurer
15fe144107
Fix the build on linux after 773c722572e0d95277ca4137df180d06a53d8718
2017-06-02 19:01:22 +02:00
Johannes Weiß
2d97c8c25d
make the selector ready function take a closure instead of returning array
2017-06-02 17:34:08 +01:00
Norman Maurer
cc0e94bdc4
Remove unused method, which also did not respect the offset / readerIndex etc correctly
2017-06-02 11:28:57 +02:00
Norman Maurer
66b7a80888
Remove redundant assert checks
2017-06-02 10:46:00 +02:00
Norman Maurer
b0b9caa324
No need to do a syscall if the user wrote a empty buffer
2017-06-02 10:23:05 +02:00
Norman Maurer
488dcdcb5e
Add methods to ByteBufferAllocator that allows wrapping existing Data
2017-06-01 19:24:35 +02:00
Norman Maurer
29b4ad373b
Correctly distribute work across EVentLoops
2017-06-01 17:59:50 +02:00
Norman Maurer
b915af9987
Rename write(string) to writeString(...), make it faster and add setter as well
2017-06-01 16:23:46 +02:00
Norman Maurer
89badeec24
Correctly reset the tail and also only set flush checkpoint one time
2017-06-01 13:09:17 +02:00
Norman Maurer
82309a5320
No need to check if in EventLoop if we already know this
2017-05-31 13:07:00 +02:00
Norman Maurer
9b79aba3b2
No need to convert to IOError if EWOULDBLOCK
2017-05-31 20:24:28 +02:00
Johannes Weiß
ec47eb0677
specialise the syscall wrapper for Int/Int32
2017-05-31 19:02:36 +01:00