|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmoka.lang.Object
moka.io.IOStream
moka.io.Socket
This class implements sockets. A socket is an endpoint for communication between two machines.
The actual work of the socket is performed by encapsulating the TIOS link functions.
Field Summary | |
int |
timeout
The timeout, in 1/20th of second. |
Fields inherited from class moka.io.IOStream |
error, opened |
Constructor Summary | |
Socket()
Creates an unconnected socket. |
Method Summary | |
void |
close()
Closes the socket. |
void |
open()
Opens the socket for reading and writting. |
char |
readByte()
Reads an 8 bit byte. |
void |
readBytes(moka.io.char_p buffer,
short len)
Copies to a buffer of bytes up to the specified length bytes read from the stream. |
void |
writeByte(char val)
Writes an 8 bit byte. |
void |
writeBytes(moka.io.char_p buffer,
short len)
Writes a buffer of bytes up to the specified length. |
Methods inherited from class moka.io.IOStream |
finalize, readBoolean, readChar, readChars, readDouble, readInt, readLong, readObject, readShort, readString, writeBoolean, writeChar, writeChars, writeDouble, writeInt, writeLong, writeObject, writeShort, writeString |
Methods inherited from class moka.lang.Object |
equals, getClassName, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int timeout
Constructor Detail |
public Socket()
Method Detail |
public void open()
open
in class IOStream
public void close()
close
in class IOStream
public void writeByte(char val)
writeByte
in class IOStream
val
- the byte value to be writtenpublic void writeBytes(moka.io.char_p buffer, short len)
writeBytes
in class IOStream
buffer
- the buffer of bytes to be writtenlen
- the specified lengthpublic char readByte()
readByte
in class IOStream
public void readBytes(moka.io.char_p buffer, short len)
readBytes
in class IOStream
buffer
- the buffer of bytes where the bytes will be copiedlen
- the specified length
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |