Package com.badlogic.gdx.net
Class NetJavaSocketImpl
- java.lang.Object
-
- com.badlogic.gdx.net.NetJavaSocketImpl
-
- All Implemented Interfaces:
Socket,Disposable
public class NetJavaSocketImpl extends java.lang.Object implements Socket
Socket implementation using java.net.Socket.
-
-
Constructor Summary
Constructors Constructor Description NetJavaSocketImpl(Net.Protocol protocol, java.lang.String host, int port, SocketHints hints)NetJavaSocketImpl(java.net.Socket socket, SocketHints hints)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Releases all resources of this object.java.io.InputStreamgetInputStream()java.io.OutputStreamgetOutputStream()java.lang.StringgetRemoteAddress()booleanisConnected()
-
-
-
Constructor Detail
-
NetJavaSocketImpl
public NetJavaSocketImpl(Net.Protocol protocol, java.lang.String host, int port, SocketHints hints)
-
NetJavaSocketImpl
public NetJavaSocketImpl(java.net.Socket socket, SocketHints hints)
-
-
Method Detail
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceSocket- Returns:
- whether the socket is connected
-
getInputStream
public java.io.InputStream getInputStream()
- Specified by:
getInputStreamin interfaceSocket- Returns:
- the
InputStreamused to read data from the other end of the connection.
-
getOutputStream
public java.io.OutputStream getOutputStream()
- Specified by:
getOutputStreamin interfaceSocket- Returns:
- the
OutputStreamused to write data to the other end of the connection.
-
getRemoteAddress
public java.lang.String getRemoteAddress()
- Specified by:
getRemoteAddressin interfaceSocket- Returns:
- the RemoteAddress of the Socket as String
-
dispose
public void dispose()
Description copied from interface:DisposableReleases all resources of this object.- Specified by:
disposein interfaceDisposable
-
-