-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ea30c0
commit cda0b98
Showing
5 changed files
with
47 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 5 additions & 9 deletions
14
helidon-ws-server/src/main/scala/functions/helidon/ws/ServerWsListener.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
package functions.helidon.ws | ||
|
||
import functions.fibers.FiberExecutor | ||
import functions.helidon.ws.transport.ClientServerWsListener | ||
import functions.model.InvokerMap | ||
import io.helidon.common.buffers.BufferData | ||
import io.helidon.websocket.{WsListener, WsSession} | ||
|
||
class ServerWsListener(invokerMap: InvokerMap) extends WsListener: | ||
|
||
private val protocol = new InOutMessageProtocol(invokerMap) | ||
|
||
override def onMessage(session: WsSession, buffer: BufferData, last: Boolean): Unit = | ||
val out = protocol.serverListener(buffer) | ||
session.send(out, true) | ||
object ServerWsListener: | ||
def apply(invokerMap: InvokerMap, fiberExecutor: FiberExecutor, sendTimeoutInMillis: Long = 4000) = | ||
new ClientServerWsListener(new InOutMessageProtocol(invokerMap), fiberExecutor, sendTimeoutInMillis) |