openConnection

A wrapper for $(D_PSYMBOL createConnection()) returning a (reader, writer) pair.

The reader returned is a $(D_PSYMBOL StreamReader) instance; the writer is a $(D_PSYMBOL StreamWriter) instance.

The arguments are all the usual arguments to $(D_PSYMBOL createConnection()) except protocolFactory; most common are host and port, with various optional arguments following.

Additional arguments are $(D_PSYMBOL eventLoop) (to set the event loop instance to use) and $(D_PSYMBOL limit) (to set the buffer limit passed to the $(D_PSYMBOL StreamReader)).

(If you want to customize the $(D_PSYMBOL StreamReader) and/or $(D_PSYMBOL StreamReaderProtocol) classes, just copy the code -- there's really nothing special here except some convenience.)

openConnection
(,
in char[] host = null
,
in char[] service = null
,
size_t limit = DEFAULT_LIMIT
,,
AddressFamily addressFamily = UNSPECIFIED!AddressFamily
,
ProtocolType protocolType = UNSPECIFIED!ProtocolType
,
AddressInfoFlags addressInfoFlags = UNSPECIFIED!AddressInfoFlags
,
Socket socket = null
,
in char[] localHost = null
,
in char[] localService = null
,
in char[] serverHostname = null
)

Meta