Class: MCPClient::Auth::BrowserOAuth::CallbackServer

Inherits:
Object
  • Object
show all
Defined in:
lib/mcp_client/auth/browser_oauth.rb

Overview

Wrapper class for TCPServer to provide shutdown interface

Instance Method Summary collapse

Constructor Details

#initialize(tcp_server, thread, stop_callback) ⇒ CallbackServer



405
406
407
408
409
# File 'lib/mcp_client/auth/browser_oauth.rb', line 405

def initialize(tcp_server, thread, stop_callback)
  @tcp_server = tcp_server
  @thread = thread
  @stop_callback = stop_callback
end

Instance Method Details

#shutdownObject



411
412
413
414
415
416
417
418
419
420
# File 'lib/mcp_client/auth/browser_oauth.rb', line 411

def shutdown
  # Signal the thread to stop
  @stop_callback&.call

  # Close the server socket
  @tcp_server&.close

  # Wait for thread to finish (with timeout)
  @thread&.join(2)
end