Skip to content

Commit

Permalink
Merge pull request #22 from bafto/websocket-interface
Browse files Browse the repository at this point in the history
exposed the websocket interface to make it more customizable
  • Loading branch information
tliron authored Nov 29, 2023
2 parents dbc79d0 + 942e1ae commit 0383824
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (self *Server) getWebSocketConn(socket *websocket.Conn) *jsonrpc2.Conn {
return jsonrpc2.NewConn(self.Context, wsjsonrpc2.NewObjectStream(socket), handler, connectionOptions...)
}

func (self *Server) serveWebSocket(socket *websocket.Conn) {
func (self *Server) ServeWebSocket(socket *websocket.Conn) {
<-self.getWebSocketConn(socket).DisconnectNotify()
}

Expand Down
2 changes: 1 addition & 1 deletion server/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (self *Server) RunWebSocket(address string) error {
connectionId := connectionCount

self.Log.Infof("received incoming WebSocket connection #%d", connectionId)
self.serveWebSocket(connection)
self.ServeWebSocket(connection)
self.Log.Infof("WebSocket connection #%d closed", connectionId)
})

Expand Down

0 comments on commit 0383824

Please sign in to comment.