|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.zerjio.JIRC.IRCConnection
A class that allows the basic communication between an IRC Client and
an IRC Server.
It can connect
and disconnect
from the server,
and it can read
and write
.
Constructor Summary | |
protected |
IRCConnection(java.lang.String server,
int port)
Creates a connection between the IRC Client and a specified IRC Server, which can be used to read() and write(...) |
Method Summary | |
protected void |
disconnect()
Turn off the connection, not allowing more writings nor readings. |
protected boolean |
isClosed()
Checks if the connection is closed. |
protected byte[] |
read()
Reads the available bytes sent by the server. |
protected boolean |
write(byte[] msg)
Sends information to the IRC Server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected IRCConnection(java.lang.String server, int port) throws java.io.IOException
read()
and write(...)
to it.
server
- The server name, or null
for the loopback address.port
- The port number.
java.io.IOException
- if there was a problem when trying to connect to the IRC server.read()
,
write(byte[] msg)
Method Detail |
protected boolean isClosed()
true
if the connection is closed (no further writing nor reading).
false
if the connection is NOT closed (writing and reading allowed).protected void disconnect() throws java.io.IOException
java.io.IOException
- if there was an error when disconnecting.protected byte[] read()
null
if there
are no available bytes.protected boolean write(byte[] msg)
msg
- The bytes that must be send to the IRC Server.
true
if the message were sent without problem
false
if there was some error sending the message.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |