APIdia Launch Partner
Top Description Methods
com.badlogic.gdx.net

public Interface Socket

extends Disposable
Known Direct Implementers
com.badlogic.gdx.net.NetJavaSocketImpl
Imports
java.io.InputStream, .OutputStream, com.badlogic.gdx.Net, .Net.Protocol, com.badlogic.gdx.utils.Disposable

A client socket that talks to a server socket via some Protocol. See Net#newClientSocket(Protocol, String, int, SocketHints) and Net#newServerSocket(Protocol, int, ServerSocketHints).

A socket has an InputStream used to send data to the other end of the connection, and an OutputStream to receive data from the other end of the connection.

A socket needs to be disposed if it is no longer used. Disposing also closes the connection.
Author
mzechner

Method Summary

Modifier and TypeMethod and Description
public InputStream
getInputStream()

Returns: the InputStream used to read data from the other end of the connection.

public OutputStream
getOutputStream()

Returns: the OutputStream used to write data to the other end of the connection.

public String
getRemoteAddress()

Returns: the RemoteAddress of the Socket as String

public boolean
isConnected()

Returns: whether the socket is connected

Inherited from com.badlogic.gdx.utils.Disposable:
dispose

Method Detail

getInputStreamback to summary
public InputStream getInputStream()
Returns:InputStream

the InputStream used to read data from the other end of the connection.

getOutputStreamback to summary
public OutputStream getOutputStream()
Returns:OutputStream

the OutputStream used to write data to the other end of the connection.

getRemoteAddressback to summary
public String getRemoteAddress()
Returns:String

the RemoteAddress of the Socket as String

isConnectedback to summary
public boolean isConnected()
Returns:boolean

whether the socket is connected