Java.Net.Socket Members

The members of Java.Net.Socket are listed below.

See Also: Inherited members from Java.Lang.Object

Public Constructors

Creates a new unconnected socket.
Creates a new unconnected socket using the given proxy type.
Creates a new streaming socket connected to the target host specified by the parameters dstAddress and dstPort.
Creates a new streaming socket connected to the target host specified by the parameters dstName and dstPort.
Creates a new streaming or datagram socket connected to the target host specified by the parameters addr and port.
Creates a new streaming or datagram socket connected to the target host specified by the parameters hostName and port.
Creates a new streaming socket connected to the target host specified by the parameters dstAddress and dstPort.
Creates a new streaming socket connected to the target host specified by the parameters dstName and dstPort.

Protected Constructors

Creates an unconnected socket with the given socket implementation.
A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
ChannelJava.Nio.Channels.SocketChannel. Returns this socket's SocketChannel, if one exists.
[read-only]
InetAddressInetAddress. Returns the IP address of the target host this socket is connected to, or null if this socket is not yet connected.
[read-only]
InputStreamSystem.IO.Stream. Returns an input stream to read data from this socket.
[read-only]
IsBoundbool. Returns whether this socket is bound to a local address and port.
[read-only]
IsClosedbool. Returns whether this socket is closed.
[read-only]
IsConnectedbool. Returns whether this socket is connected to a remote host.
[read-only]
IsInputShutdownbool. Returns whether the incoming channel of the socket has already been closed.
[read-only]
IsOutputShutdownbool. Returns whether the outgoing channel of the socket has already been closed.
KeepAlivebool. Returns this socket's SocketOptions.SoKeepalive setting.
[read-only]
LocalAddressInetAddress. Returns the local IP address this socket is bound to, or an address for which InetAddress.IsAnyLocalAddress returns true if the socket is closed or unbound.
[read-only]
LocalPortint. Returns the local port this socket is bound to, or -1 if the socket is unbound.
[read-only]
LocalSocketAddressSocketAddress. Returns the local address and port of this socket as a SocketAddress or null if the socket has never been bound.
OOBInlinebool. Returns this socket's SocketOptions.SoOobinline setting.
[read-only]
OutputStreamSystem.IO.Stream. Returns an output stream to write data into this socket.
[read-only]
Portint. Returns the port number of the target host this socket is connected to, or 0 if this socket is not yet connected.
ReceiveBufferSizeint. Returns this socket's SocketOptions.SoRcvbuf.
[read-only]
RemoteSocketAddressSocketAddress. Returns the remote address and port of this socket as a SocketAddress or null if the socket is not connected.
ReuseAddressbool. Returns this socket's SocketOptions.SoReuseaddr setting.
SendBufferSizeint. Returns this socket's SocketOptions.SoSndbuf.
[read-only]
SoLingerint. Returns this socket's SocketOptions.SoLinger timeout in seconds, or -1 for no linger (i.e.
SoTimeoutint. Returns this socket's SocketOptions.SoTimeout.
TcpNoDelaybool. Returns this socket's SocketOptions#TCP_NODELAY setting.
TrafficClassint. Returns this socket's setting.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Bind(SocketAddress)
Binds this socket to the given local host address and port specified by the SocketAddress localAddr.
Close()
Closes the socket.
Connect(SocketAddress)
Connects this socket to the given remote host address and port specified by the SocketAddress remoteAddr.
Connect(SocketAddress, int)
Connects this socket to the given remote host address and port specified by the SocketAddress remoteAddr with the specified timeout.
ConnectAsync(SocketAddress) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
ConnectAsync(SocketAddress, int) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
SendUrgentData(int)
Sends the given single byte data which is represented by the lowest octet of value as "TCP urgent data".
SendUrgentDataAsync(int) : System.Threading.Tasks.Task
Documentation for this section has not yet been entered.
SetPerformancePreferences(int, int, int)
Sets performance preferences for connectionTime, latency and bandwidth.
static
SetSocketImplFactory(ISocketImplFactory)
Sets the internal factory for creating socket implementations.
SetSoLinger(bool, int)
Sets this socket's SocketOptions.SoLinger timeout in seconds.
ShutdownInput()
Closes the input stream of this socket.
ShutdownOutput()
Closes the output stream of this socket.