|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object processing.net.Client
public class Client
Field Summary | |
---|---|
java.io.InputStream |
input
|
java.io.OutputStream |
output
|
Constructor Summary | |
---|---|
Client(PApplet parent,
java.net.Socket socket)
|
|
Client(PApplet parent,
java.lang.String host,
int port)
|
Method Summary | |
---|---|
boolean |
active()
Return true if this client is still active and hasn't run into any trouble. |
int |
available()
Returns the number of bytes that have been read from serial and are waiting to be dealt with by the user. |
void |
clear()
Ignore all the bytes read so far and empty the buffer. |
void |
dispose()
Disconnect from the server: internal use only. |
java.lang.String |
ip()
Returns the ip address of this feller as a String. |
int |
read()
Returns a number between 0 and 255 for the next byte that's waiting in the buffer. |
byte[] |
readBytes()
Return a byte array of anything that's in the serial buffer. |
int |
readBytes(byte[] outgoing)
Grab whatever is in the serial buffer, and stuff it into a byte buffer passed in by the user. |
byte[] |
readBytesUntil(int interesting)
Reads from the serial port into a buffer of bytes up to and including a particular character. |
int |
readBytesUntil(int interesting,
byte[] outgoing)
Reads from the serial port into a buffer of bytes until a particular character. |
char |
readChar()
Returns the next byte in the buffer as a char. |
java.lang.String |
readString()
Return whatever has been read from the serial port so far as a String. |
java.lang.String |
readStringUntil(int interesting)
Combination of readBytesUntil and readString. |
void |
run()
|
void |
stop()
Disconnect from the server and calls disconnectEvent(Client c) in the host PApplet. |
void |
write(byte[] bytes)
|
void |
write(int what)
This will handle ints, bytes and chars transparently. |
void |
write(java.lang.String what)
Write a String to the output. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.io.InputStream input
public java.io.OutputStream output
Constructor Detail |
---|
public Client(PApplet parent, java.lang.String host, int port)
public Client(PApplet parent, java.net.Socket socket) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void stop()
public void dispose()
This should only be called by the internal functions in PApplet, use stop() instead from within your own applets.
public void run()
run
in interface java.lang.Runnable
public boolean active()
public java.lang.String ip()
public int available()
public void clear()
public int read()
public char readChar()
public byte[] readBytes()
public int readBytes(byte[] outgoing)
public byte[] readBytesUntil(int interesting)
public int readBytesUntil(int interesting, byte[] outgoing)
public java.lang.String readString()
public java.lang.String readStringUntil(int interesting)
public void write(int what)
public void write(byte[] bytes)
public void write(java.lang.String what)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |