public class NetSIDDevConnection extends Object
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection.
|
static NetSIDDevConnection |
getInstance() |
void |
invalidate()
Invalidate the connection.
|
boolean |
isDisconnected() |
boolean |
isInvalidated()
Connection has been invalidated?
|
void |
open(String hostname,
int port)
Connect to server, if not already connected or connection changed
|
int |
receive()
Receive byte from server.
|
String |
receiveString()
Receive zero terminated byte array as string (ISO-88-59-1).
|
void |
send(byte[] cmd)
Send byte array to server.
|
public static final NetSIDDevConnection getInstance()
public void open(String hostname, int port) throws IOException
hostname
- server host nameport
- server port addressIOException
- socket I/O errorpublic void close()
public void invalidate()
public boolean isInvalidated()
public void send(byte[] cmd) throws IOException
cmd
- byte array to sendIOException
- socket I/O errorpublic int receive() throws IOException
IOException
- socket I/O errorpublic String receiveString() throws IOException
IOException
- socket I/O errorpublic boolean isDisconnected()
Copyright © 2018 Ken Händel. All rights reserved.