Skip to content

Commit 8517ba8

Browse files
committed
(GH-187) Partial Revert 3690ca2
Previously commit 3690ca2 the Socket connection object was modified for the STDIO server. However this was causing issues and was not required. This commit partially reverts the changes in 3690ca2 to the TCP Server and JSON Handler to the parent commit.
1 parent 090c83b commit 8517ba8

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

server/lib/puppet-languageserver/json_rpc_handler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module PuppetLanguageServer
3737
KEY_CODE = 'code'.freeze
3838
KEY_MESSAGE = 'message'.freeze
3939

40-
class JSONRPCHandler < PuppetVSCode::SocketConnection
40+
class JSONRPCHandler < PuppetVSCode::SimpleTCPServerConnection
4141
def initialize(*_options)
4242
@key_jsonrpc = KEY_JSONRPC
4343
@key_id = KEY_ID

server/lib/puppet-vscode/simple_tcp_server.rb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
# http://stackoverflow.com/questions/29858113/unable-to-make-socket-accept-non-blocking-ruby-2-2
55

66
module PuppetVSCode
7-
class SocketConnection
7+
class SimpleTCPServerConnection
88
attr_accessor :socket
9+
attr_accessor :simple_tcp_server
910

1011
# Methods to override
1112
def post_init
@@ -34,21 +35,6 @@ def send_data(data)
3435
true
3536
end
3637

37-
# @api public
38-
def close_connection_after_writing
39-
true
40-
end
41-
42-
# @api public
43-
def close_connection
44-
true
45-
end
46-
end
47-
48-
class SimpleTCPServerConnection < SocketConnection
49-
attr_accessor :socket
50-
attr_accessor :simple_tcp_server
51-
5238
# @api public
5339
def close_connection_after_writing
5440
socket.flush

0 commit comments

Comments
 (0)