Contains the heart of Sok. All the client and server socket classes are here
TCPClientSocket | expect class 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. |
TCPServerSocket | expect class TCPServerSocket Class representing a listening socket. You can use it to perform accept() operation only. |
createTCPClientSocket | suspend expect fun createTCPClientSocket(address: String , port: Int ): TCPClientSocket Create a client socket with the given address and port. This function will throw a ConnectionRefusedException if the socket failed to connect. |
createTCPServerSocket | suspend expect fun createTCPServerSocket(address: String , port: Int ): TCPServerSocket Start a listening socket on the given address (or alias) and port |