Method: Cod.tcp

Defined in:
lib/cod.rb

.tcp(destination, serializer = nil) ⇒ Cod::TcpClient

Creates a tcp connection to the destination and returns a channel for it.

Parameters:

  • destination (String)

    an address to connect to, like ‘localhost:1234’

  • serializer (#en, #de) (defaults to: nil)

    optional serializer to use

Returns:



87
88
89
90
91
# File 'lib/cod.rb', line 87

def tcp(destination, serializer=nil)
  Cod::TcpClient.new(
    destination, 
    serializer || SimpleSerializer.new)
end