RawSynchronousSocket abstract class

A low-level class for communicating synchronously over a TCP socket.

Warning: RawSynchronousSocket should probably only be used to connect to 'localhost'. The operations below will block the calling thread to wait for a response from the network. The thread can process no other events while waiting for these operations to complete. RawSynchronousSocket is not suitable for applications that require high performance or asynchronous I/O such as a server. Instead such applications should use the non-blocking sockets and asynchronous operations in the Socket or RawSocket classes.

Static Methods

connectSync(host, int port) → RawSynchronousSocket

Creates a new socket connection and returns a RawSynchronousSocket.

Constructors

RawSynchronousSocket()

Properties

addressInternetAddress
read-only

The InternetAddress used to connect this socket.

portint
read-only

The port used by this socket.

remoteAddressInternetAddress
read-only

The remote InternetAddress connected to by this socket.

remotePortint
read-only

The remote port connected to by this socket.

hashCodeint
read-only, inherited

The hash code for this object.

runtimeTypeType
read-only, inherited

A representation of the runtime type of the object.

Operators

operator ==(other) → bool
inherited

The equality operator.

Methods

available() → int

Returns the number of received and unread bytes in the socket that can be read.

closeSync() → void

Closes the RawSynchronousSocket.

readIntoSync(List<int> buffer, [ int start = 0, int end ]) → int

Reads into an existing List<int> from the socket into the range: [start,end).

readSync(int bytes) → List<int>

Reads up to bytes bytes from the socket.

shutdown(SocketDirection direction) → void

Shutdown a socket in the provided direction.

writeFromSync(List<int> buffer, [ int start = 0, int end ]) → void

Writes data from a specified range in a List<int> to the socket.

noSuchMethod(Invocation invocation) → dynamic
inherited

Invoked when a non-existent method or property is accessed.

toString() → String
inherited

Returns a string representation of this object.

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-io/RawSynchronousSocket-class.html