W3cubDocs

/Dart 2

connectSync method

RawSynchronousSocket connectSync (dynamic host, int port)

Creates a new socket connection and returns a RawSynchronousSocket.

host can either be a String or an InternetAddress. If host is a String, connectSync will perform a InternetAddress.lookup and try all returned InternetAddresses, until connected. Unless a connection was established, the error from the first failing connection is returned.

Implementation

external static RawSynchronousSocket connectSync(host, int port);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-io/RawSynchronousSocket/connectSync.html