Sok.Exceptions.AddressInUseException |
Exception thrown when trying to bind a socket to an address/port already bound |
Sok.Exceptions.BufferDestroyedException |
Exception thrown when trying to modify the buffer after the destroy() method was called |
Sok.Exceptions.BufferOverflowException |
Exception thrown when trying to put a value too large for the remaining space in the buffer |
Sok.Buffer.BufferPool |
In order to avoid garbage collection pressure it is a common practice to pre-allocate objects that are known to be long-living for a later use, Kotlin channels give us a great way to implement a quite straightforward object pool. The pool will allocate all the buffers lazily when needed, this means that the pool will never suspend until reaching the maximum size. |
Sok.Exceptions.BufferUnderflowException |
Exception thrown when trying to read a value too large for the remaining space in the buffer |
Sok.Exceptions.CloseException |
Parent class of the exceptions thrown when gracefully closing a socket |
Sok.Exceptions.ConcurrentReadingException |
Exception thrown when trying to read the socket while another read call is executing |
Sok.Exceptions.ConnectionRefusedException |
Exception thrown when a client tries to connect and fails |
Sok.Exceptions.ForceCloseException |
Exception passed to the socket exception handler whent the socket is forcefully closed by a call to the forceClose method |
Sok.Selector.Interests |
Enum representing the possible interests of a SelectionKey |
Sok.Buffer.JSMultiplatformBuffer |
JS implementation of the MultiplatformBuffer class |
Sok.Buffer.JVMMultiplatformBuffer |
JVM implementation of the MultiplatformBuffer class |
Sok.Buffer.MultiplatformBuffer |
A MultiplatformBuffer is the primitive type of Sok, you will use it to receive, send and manipulate data |
Sok.Buffer.NativeMultiplatformBuffer |
Native implementation of the MultiplatformBuffer class |
Sok.Exceptions.NormalCloseException |
Exception passed to the socket exception handler when the socket is gracefully closed by a call to the close method |
Sok.Exceptions.OptionNotSupportedException |
Exception thrown when trying to get/set a socket option not supported on the platform |
Sok.Socket.Options.Options |
Enum representing all the available options. Please keep in mind that all options are not supported by al the platforms |
Sok.Exceptions.PeerClosedException |
Exception thrown when trying to perform an I/O on a closed socket |
Sok.Selector.Selector |
The Sok Selector class helps to go from a crappy blocking NIO Selector interface to a nice coroutine based interface. The Selector will take care of registrations to the underlying NIO Selector in a non-blocking and non-suspending way in order to have the best performances possible. In order to do that (and because the NIO Selector is blocking) the Selector have a single thread executor to which we will give “ticks” tasks, when a socket wants to register we will pause the ticking, register and send a resume task to the executor, if the registration task is fast enough the ticking will not be paused. |
Sok.Selector.SelectorPool |
A SelectorPool will order the Selectors by the number of channels registered. This allow us to do a basic load balancing between all the Selectors |
Sok.Exceptions.SocketClosedException |
Exception thrown when trying to perform an I/O on a closed socket |
Sok.Socket.Options.SocketOption |
Class representing a socket option and its type |
Sok.Exceptions.SokException |
Parent class of any exception thrown by Sok |
Sok.Socket.TCP.TCPClientSocket |
Class representing a client socket. You can use it to perform any I/O operation. Keep in mind that this class keep an internal queue for write operations thus storing data until written so you should have some kind of backpressure mechanism to prevent the accumulation of too many data. |
Sok.Socket.TCP.TCPServerSocket |
Class representing a listening socket. You can use it to perform accept() operation only. |