Class: Ignis::Collective::NetworkDirect::Connector
- Inherits:
-
Object
- Object
- Ignis::Collective::NetworkDirect::Connector
- Defined in:
- lib/nvruby/collective/net/nd_adapter.rb
Overview
Connector for RDMA connection establishment
Instance Attribute Summary collapse
-
#adapter ⇒ Adapter
readonly
Parent adapter.
-
#handle ⇒ FFI::Pointer
readonly
Native connector handle.
Instance Method Summary collapse
-
#accept(qp:, private_data: nil) ⇒ void
Accept connection (server side).
-
#bind(address:, port:) ⇒ void
Bind to local address.
-
#close! ⇒ void
Close the connector.
-
#connect(qp:, remote_address:, remote_port:, private_data: nil) ⇒ void
Connect to remote peer (client side).
-
#disconnect! ⇒ void
Disconnect.
-
#initialize(adapter) ⇒ Connector
constructor
A new instance of Connector.
Constructor Details
#initialize(adapter) ⇒ Connector
Returns a new instance of Connector.
377 378 379 380 381 382 |
# File 'lib/nvruby/collective/net/nd_adapter.rb', line 377 def initialize(adapter) @adapter = adapter @handle = nil @bound = false @connected = false end |
Instance Attribute Details
#adapter ⇒ Adapter (readonly)
Returns Parent adapter.
372 373 374 |
# File 'lib/nvruby/collective/net/nd_adapter.rb', line 372 def adapter @adapter end |
#handle ⇒ FFI::Pointer (readonly)
Returns Native connector handle.
375 376 377 |
# File 'lib/nvruby/collective/net/nd_adapter.rb', line 375 def handle @handle end |
Instance Method Details
#accept(qp:, private_data: nil) ⇒ void
This method returns an undefined value.
Accept connection (server side)
418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/nvruby/collective/net/nd_adapter.rb', line 418 def accept(qp:, private_data: nil) raise RDMAError, "Not bound" unless @bound # In real implementation: # 1. Listen for incoming connection # 2. GetConnectionRequest # 3. Accept with QP @connected = true qp.set_connected! end |
#bind(address:, port:) ⇒ void
This method returns an undefined value.
Bind to local address
388 389 390 391 392 393 394 395 |
# File 'lib/nvruby/collective/net/nd_adapter.rb', line 388 def bind(address:, port:) return if @bound # In real implementation: IND2Connector::Bind @local_address = address @local_port = port @bound = true end |
#close! ⇒ void
This method returns an undefined value.
Close the connector
441 442 443 444 445 446 |
# File 'lib/nvruby/collective/net/nd_adapter.rb', line 441 def close! disconnect! if @connected # Release handle @handle = nil @bound = false end |
#connect(qp:, remote_address:, remote_port:, private_data: nil) ⇒ void
This method returns an undefined value.
Connect to remote peer (client side)
403 404 405 406 407 408 409 410 411 412 |
# File 'lib/nvruby/collective/net/nd_adapter.rb', line 403 def connect(qp:, remote_address:, remote_port:, private_data: nil) raise RDMAError, "Not bound" unless @bound # In real implementation: IND2Connector::Connect # Then poll for completion # Then CompleteConnect @connected = true qp.set_connected! end |
#disconnect! ⇒ void
This method returns an undefined value.
Disconnect
432 433 434 435 436 437 |
# File 'lib/nvruby/collective/net/nd_adapter.rb', line 432 def disconnect! return unless @connected # In real implementation: IND2Connector::Disconnect @connected = false end |