|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--smtp_relayserver.UDPClient
This class allows you to send and receive Strings and byte arrays via UDP without concerning yourself with DatagramPackets and DatagramSockets.
Copyright (C) 1998 Valentin Koch
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
| Constructor Summary | |
UDPClient(java.lang.String remoteHost,
int port)
Creates a new UDPClient. |
|
| Method Summary | |
int |
getLocalPort()
|
byte[] |
receive()
This method blocks until a UDP Datagram is received from the host with which this UDPClient communicates. |
void |
send(byte[] buffer)
This method sends data to the remote host via UDP. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UDPClient(java.lang.String remoteHost,
int port)
throws java.net.UnknownHostException,
java.net.SocketException
remoteHost - The domain name of the remote host to which data will be sentport - The port on the remote host to which data will be sentjava.net.UnknownHostException - The remoteHost is unknownjava.net.SocketException - En error occured by creating a DatagrammSocket| Method Detail |
public void send(byte[] buffer)
throws java.io.IOException
buffer - A byte array containing the data to be sentjava.io.IOException - An error occured by sending the DatagrammPacket
public byte[] receive()
throws java.io.IOException
java.io.IOException - An error occured by receiving a DatagrammPacketpublic int getLocalPort()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||