object impl
- Source
- SSLSocket.scala
- Alphabetic
- By Inheritance
- impl
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
SocketStatus
[F[_]](buff: Chunk[Byte], handshakeInProgress: Boolean, notifyHandshakeDone: Vector[F[Unit]]) extends Product with Serializable
Status of the socket
Status of the socket
- buff
Remaining data that was acquired during handshaking but were not consumed by any
read
operation- handshakeInProgress
indication that handshake is in progress.
- notifyHandshakeDone
If
handshakeInProgress
is true, this contains all operations to be notified when handshake is done.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
acquireFromBuffer[F[_]](max: Int, statusRef: Ref[F, SocketStatus[F]])(implicit F: Async[F]): F[Chunk[Byte]]
Acquires up to max bytes from the chunk in buffer.
Acquires up to max bytes from the chunk in buffer. May return empty chunk
- def appendToBuffer[F[_]](chunk: Chunk[Byte], statusRef: Ref[F, SocketStatus[F]])(implicit F: Async[F]): F[Unit]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
awaitHandshakeComplete[F[_]](statusRef: Ref[F, SocketStatus[F]])(implicit F: Async[F]): F[Unit]
Invoked when handshake shall be in process and shall finish when handshake is complete
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
concat(a: Chunk[Byte], b: Chunk[Byte]): Chunk[Byte]
concats a, b if they are nonempty *
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
performHandshake[F[_]](socket: Socket[F], sslEngine: SSLEngine[F], statusRef: Ref[F, SocketStatus[F]], handshakeTimeout: Option[FiniteDuration], writeSemaphore: Semaphore[F], readSemaphore: Semaphore[F])(implicit F: Async[F]): F[Unit]
Perform SSL handshake.
Perform SSL handshake. This completes when handshake is complete and will trigger all handshake awaiting tasks to be run.
- socket
Socket to send/receive raw data
- sslEngine
SSL engine
- statusRef
Status reference to acquire handshake lock and register for callback
- handshakeTimeout
Timeout to perform the handshake
-
def
read[F[_]](socket: Socket[F], sslEngine: SSLEngine[F], maxSize: Int, timeout: Option[FiniteDuration], statusRef: Ref[F, SocketStatus[F]], writeSemaphore: Semaphore[F], readSemaphore: Semaphore[F])(implicit F: Async[F]): F[Option[Chunk[Byte]]]
Perform read operation of up to
maxSize
bytes.Perform read operation of up to
maxSize
bytes.May return None indicating EOF. If handshake needs to be done during the read process, this will perform that handshake before returning.
- socket
Socket to use to receive data
- sslEngine
SSL Engine
- maxSize
Max size of data to return (may be less or empty)
- timeout
Timeout to await the read operation
- statusRef
A reference to state
- writeSemaphore
Write semaphore guarding any writed
- readSemaphore
Read semaphore guarding any reads
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
write[F[_]](socket: Socket[F], sslEngine: SSLEngine[F], bytes: Chunk[Byte], timeout: Option[FiniteDuration], statusRef: Ref[F, SocketStatus[F]], writeSemaphore: Semaphore[F], readSemaphore: Semaphore[F])(implicit F: Async[F]): F[Unit]
Write supplied data to the destination socket.
Write supplied data to the destination socket.
When the handshake is in process, this will complete _AFTER_ handshake is complete.
- socket
Socket to write encrypted data to
- sslEngine
SSLEngine to use
- bytes
bytes to write
- timeout
A timeout to write the data
- object SocketStatus extends Serializable