commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwins...@apache.org
Subject svn commit: r489397 [2/5] - in /jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java: examples/ examples/nntp/ examples/ntp/ org/apache/commons/net/ org/apache/commons/net/bsd/ org/apache/commons/net/chargen/ org/apache/commons/net/daytime/...
Date Thu, 21 Dec 2006 16:28:56 GMT
Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/MalformedServerReplyException.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/MalformedServerReplyException.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/MalformedServerReplyException.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/MalformedServerReplyException.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net;
 
 import java.io.IOException;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/PrintCommandListener.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/PrintCommandListener.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/PrintCommandListener.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/PrintCommandListener.java Thu Dec 21 08:28:51 2006
@@ -1,50 +1,52 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net;
-
-import java.io.PrintWriter;
-import org.apache.commons.net.ProtocolCommandEvent;
-import org.apache.commons.net.ProtocolCommandListener;
-
-/***
- * This is a support class for some of the example programs.  It is
- * a sample implementation of the ProtocolCommandListener interface
- * which just prints out to a specified stream all command/reply traffic.
- * <p>
- ***/
-
-public class PrintCommandListener implements ProtocolCommandListener
-{
-    private PrintWriter __writer;
-
-    public PrintCommandListener(PrintWriter writer)
-    {
-        __writer = writer;
-    }
-
-    public void protocolCommandSent(ProtocolCommandEvent event)
-    {
-        __writer.print(event.getMessage());
-        __writer.flush();
-    }
-
-    public void protocolReplyReceived(ProtocolCommandEvent event)
-    {
-        __writer.print(event.getMessage());
-        __writer.flush();
-    }
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net;
+
+import java.io.PrintWriter;
+import org.apache.commons.net.ProtocolCommandEvent;
+import org.apache.commons.net.ProtocolCommandListener;
+
+/***
+ * This is a support class for some of the example programs.  It is
+ * a sample implementation of the ProtocolCommandListener interface
+ * which just prints out to a specified stream all command/reply traffic.
+ * <p>
+ ***/
+
+public class PrintCommandListener implements ProtocolCommandListener
+{
+    private PrintWriter __writer;
+
+    public PrintCommandListener(PrintWriter writer)
+    {
+        __writer = writer;
+    }
+
+    public void protocolCommandSent(ProtocolCommandEvent event)
+    {
+        __writer.print(event.getMessage());
+        __writer.flush();
+    }
+
+    public void protocolReplyReceived(ProtocolCommandEvent event)
+    {
+        __writer.print(event.getMessage());
+        __writer.flush();
+    }
+}
+

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net;
 import java.util.EventObject;
 

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandListener.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandListener.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandListener.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandListener.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net;
 import java.util.EventListener;
 

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net;
 
 import java.io.Serializable;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net;
 
 import java.io.IOException;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RCommandClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RCommandClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RCommandClient.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.bsd;
 
 import java.io.IOException;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RExecClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RExecClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RExecClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RExecClient.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.bsd;
 
 import java.io.IOException;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RLoginClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RLoginClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RLoginClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/bsd/RLoginClient.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.bsd;
 
 import java.io.IOException;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/chargen/CharGenTCPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/chargen/CharGenTCPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/chargen/CharGenTCPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/chargen/CharGenTCPClient.java Thu Dec 21 08:28:51 2006
@@ -1,84 +1,86 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.chargen;
-
-import java.io.InputStream;
-
-import org.apache.commons.net.SocketClient;
-
-/***
- * The CharGenTCPClient class is a TCP implementation of a client for the
- * character generator protocol described in RFC 864.  It can also be
- * used for Systat (RFC 866), Quote of the Day (RFC 865), and netstat
- * (port 15).  All of these protocols involve connecting to the appropriate
- * port, and reading data from an input stream.  The chargen protocol
- * actually sends data until the receiving end closes the connection.  All
- * of the others send only a fixed amount of data and then close the
- * connection.
- * <p>
- * To use the CharGenTCPClient class, just establish a
- * connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call {@link #getInputStream  getInputStream() } to access
- * the data.  Don't close the input stream when you're done with it.  Rather,
- * call {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to clean up properly.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see CharGenUDPClient
- ***/
-
-public final class CharGenTCPClient extends SocketClient
-{
-    /*** The systat port value of 11 according to RFC 866. ***/
-    public static final int SYSTAT_PORT = 11;
-    /*** The netstat port value of 19. ***/
-    public static final int NETSTAT_PORT = 15;
-    /*** The quote of the day port value of 17 according to RFC 865. ***/
-    public static final int QUOTE_OF_DAY_PORT = 17;
-    /*** The character generator port value of 19 according to RFC 864. ***/
-    public static final int CHARGEN_PORT = 19;
-    /*** The default chargen port.  It is set to 19 according to RFC 864. ***/
-    public static final int DEFAULT_PORT = 19;
-
-    /***
-     * The default constructor for CharGenTCPClient.  It merely sets the
-     * default port to <code> DEFAULT_PORT </code>.
-     ***/
-    public CharGenTCPClient ()
-    {
-        setDefaultPort(DEFAULT_PORT);
-    }
-
-    /***
-     * Returns an InputStream from which the server generated data can be
-     * read.  You should NOT close the InputStream when you're finished
-     * reading from it.  Rather, you should call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * to clean up properly.
-     * <p>
-     * @return An InputStream from which the server generated data can be read.
-     ***/
-    public InputStream getInputStream()
-    {
-        return _input_;
-    }
-}
-
-
-
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.chargen;
+
+import java.io.InputStream;
+
+import org.apache.commons.net.SocketClient;
+
+/***
+ * The CharGenTCPClient class is a TCP implementation of a client for the
+ * character generator protocol described in RFC 864.  It can also be
+ * used for Systat (RFC 866), Quote of the Day (RFC 865), and netstat
+ * (port 15).  All of these protocols involve connecting to the appropriate
+ * port, and reading data from an input stream.  The chargen protocol
+ * actually sends data until the receiving end closes the connection.  All
+ * of the others send only a fixed amount of data and then close the
+ * connection.
+ * <p>
+ * To use the CharGenTCPClient class, just establish a
+ * connection with
+ * {@link org.apache.commons.net.SocketClient#connect  connect }
+ * and call {@link #getInputStream  getInputStream() } to access
+ * the data.  Don't close the input stream when you're done with it.  Rather,
+ * call {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+ * to clean up properly.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see CharGenUDPClient
+ ***/
+
+public final class CharGenTCPClient extends SocketClient
+{
+    /*** The systat port value of 11 according to RFC 866. ***/
+    public static final int SYSTAT_PORT = 11;
+    /*** The netstat port value of 19. ***/
+    public static final int NETSTAT_PORT = 15;
+    /*** The quote of the day port value of 17 according to RFC 865. ***/
+    public static final int QUOTE_OF_DAY_PORT = 17;
+    /*** The character generator port value of 19 according to RFC 864. ***/
+    public static final int CHARGEN_PORT = 19;
+    /*** The default chargen port.  It is set to 19 according to RFC 864. ***/
+    public static final int DEFAULT_PORT = 19;
+
+    /***
+     * The default constructor for CharGenTCPClient.  It merely sets the
+     * default port to <code> DEFAULT_PORT </code>.
+     ***/
+    public CharGenTCPClient ()
+    {
+        setDefaultPort(DEFAULT_PORT);
+    }
+
+    /***
+     * Returns an InputStream from which the server generated data can be
+     * read.  You should NOT close the InputStream when you're finished
+     * reading from it.  Rather, you should call
+     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+     * to clean up properly.
+     * <p>
+     * @return An InputStream from which the server generated data can be read.
+     ***/
+    public InputStream getInputStream()
+    {
+        return _input_;
+    }
+}
+
+
+
+

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java Thu Dec 21 08:28:51 2006
@@ -1,127 +1,129 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.chargen;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-
-import org.apache.commons.net.DatagramSocketClient;
-
-/***
- * The CharGenUDPClient class is a UDP implementation of a client for the
- * character generator protocol described in RFC 864.  It can also be
- * used for Systat (RFC 866), Quote of the Day (RFC 865), and netstat
- * (port 15).  All of these protocols involve sending a datagram to the
- * appropriate port, and reading data contained in one or more reply
- * datagrams.  The chargen and quote of the day protocols only send
- * one reply datagram containing 512 bytes or less of data.  The other
- * protocols may reply with more than one datagram, in which case you
- * must wait for a timeout to determine that all reply datagrams have
- * been sent.
- * <p>
- * To use the CharGenUDPClient class, just open a local UDP port
- * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #send  send } to send the datagram that will
- * initiate the data reply.  For chargen or quote of the day, just
- * call {@link #receive  receive }, and you're done.  For netstat and
- * systat, call receive in a while loop, and catch a SocketException and
- * InterruptedIOException to detect a timeout (don't forget to set the
- * timeout duration beforehand).  Don't forget to call
- * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
- * to clean up properly.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see CharGenTCPClient
- ***/
-
-public final class CharGenUDPClient extends DatagramSocketClient
-{
-    /*** The systat port value of 11 according to RFC 866. ***/
-    public static final int SYSTAT_PORT = 11;
-    /*** The netstat port value of 19. ***/
-    public static final int NETSTAT_PORT = 15;
-    /*** The quote of the day port value of 17 according to RFC 865. ***/
-    public static final int QUOTE_OF_DAY_PORT = 17;
-    /*** The character generator port value of 19 according to RFC 864. ***/
-    public static final int CHARGEN_PORT = 19;
-    /*** The default chargen port.  It is set to 19 according to RFC 864. ***/
-    public static final int DEFAULT_PORT = 19;
-
-    private byte[] __receiveData;
-    private DatagramPacket __receivePacket;
-    private DatagramPacket __sendPacket;
-
-    /***
-     * The default CharGenUDPClient constructor.  It initializes some internal
-     * data structures for sending and receiving the necessary datagrams for
-     * the chargen and related protocols.
-     ***/
-    public CharGenUDPClient()
-    {
-        // CharGen return packets have a maximum length of 512
-        __receiveData = new byte[512];
-        __receivePacket = new DatagramPacket(__receiveData, 512);
-        __sendPacket = new DatagramPacket(new byte[0], 0);
-    }
-
-
-    /***
-     * Sends the data initiation datagram.  This data in the packet is ignored
-     * by the server, and merely serves to signal that the server should send
-     * its reply.
-     * <p>
-     * @param host The address of the server.
-     * @param port The port of the service.
-     * @exception IOException If an error occurs while sending the datagram.
-     ***/
-    public void send(InetAddress host, int port) throws IOException
-    {
-        __sendPacket.setAddress(host);
-        __sendPacket.setPort(port);
-        _socket_.send(__sendPacket);
-    }
-
-    /*** Same as <code>send(host, CharGenUDPClient.DEFAULT_PORT);</code> ***/
-    public void send(InetAddress host) throws IOException
-    {
-        send(host, DEFAULT_PORT);
-    }
-
-    /***
-     * Receive the reply data from the server.  This will always be 512 bytes
-     * or less.  Chargen and quote of the day only return one packet.  Netstat
-     * and systat require multiple calls to receive() with timeout detection.
-     * <p>
-     * @return The reply data from the server.
-     * @exception IOException If an error occurs while receiving the datagram.
-     ***/
-    public byte[] receive() throws IOException
-    {
-        int length;
-        byte[] result;
-
-        _socket_.receive(__receivePacket);
-
-        result = new byte[length = __receivePacket.getLength()];
-        System.arraycopy(__receiveData, 0, result, 0, length);
-
-        return result;
-    }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.chargen;
+
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.InetAddress;
+
+import org.apache.commons.net.DatagramSocketClient;
+
+/***
+ * The CharGenUDPClient class is a UDP implementation of a client for the
+ * character generator protocol described in RFC 864.  It can also be
+ * used for Systat (RFC 866), Quote of the Day (RFC 865), and netstat
+ * (port 15).  All of these protocols involve sending a datagram to the
+ * appropriate port, and reading data contained in one or more reply
+ * datagrams.  The chargen and quote of the day protocols only send
+ * one reply datagram containing 512 bytes or less of data.  The other
+ * protocols may reply with more than one datagram, in which case you
+ * must wait for a timeout to determine that all reply datagrams have
+ * been sent.
+ * <p>
+ * To use the CharGenUDPClient class, just open a local UDP port
+ * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
+ * and call {@link #send  send } to send the datagram that will
+ * initiate the data reply.  For chargen or quote of the day, just
+ * call {@link #receive  receive }, and you're done.  For netstat and
+ * systat, call receive in a while loop, and catch a SocketException and
+ * InterruptedIOException to detect a timeout (don't forget to set the
+ * timeout duration beforehand).  Don't forget to call
+ * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
+ * to clean up properly.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see CharGenTCPClient
+ ***/
+
+public final class CharGenUDPClient extends DatagramSocketClient
+{
+    /*** The systat port value of 11 according to RFC 866. ***/
+    public static final int SYSTAT_PORT = 11;
+    /*** The netstat port value of 19. ***/
+    public static final int NETSTAT_PORT = 15;
+    /*** The quote of the day port value of 17 according to RFC 865. ***/
+    public static final int QUOTE_OF_DAY_PORT = 17;
+    /*** The character generator port value of 19 according to RFC 864. ***/
+    public static final int CHARGEN_PORT = 19;
+    /*** The default chargen port.  It is set to 19 according to RFC 864. ***/
+    public static final int DEFAULT_PORT = 19;
+
+    private byte[] __receiveData;
+    private DatagramPacket __receivePacket;
+    private DatagramPacket __sendPacket;
+
+    /***
+     * The default CharGenUDPClient constructor.  It initializes some internal
+     * data structures for sending and receiving the necessary datagrams for
+     * the chargen and related protocols.
+     ***/
+    public CharGenUDPClient()
+    {
+        // CharGen return packets have a maximum length of 512
+        __receiveData = new byte[512];
+        __receivePacket = new DatagramPacket(__receiveData, 512);
+        __sendPacket = new DatagramPacket(new byte[0], 0);
+    }
+
+
+    /***
+     * Sends the data initiation datagram.  This data in the packet is ignored
+     * by the server, and merely serves to signal that the server should send
+     * its reply.
+     * <p>
+     * @param host The address of the server.
+     * @param port The port of the service.
+     * @exception IOException If an error occurs while sending the datagram.
+     ***/
+    public void send(InetAddress host, int port) throws IOException
+    {
+        __sendPacket.setAddress(host);
+        __sendPacket.setPort(port);
+        _socket_.send(__sendPacket);
+    }
+
+    /*** Same as <code>send(host, CharGenUDPClient.DEFAULT_PORT);</code> ***/
+    public void send(InetAddress host) throws IOException
+    {
+        send(host, DEFAULT_PORT);
+    }
+
+    /***
+     * Receive the reply data from the server.  This will always be 512 bytes
+     * or less.  Chargen and quote of the day only return one packet.  Netstat
+     * and systat require multiple calls to receive() with timeout detection.
+     * <p>
+     * @return The reply data from the server.
+     * @exception IOException If an error occurs while receiving the datagram.
+     ***/
+    public byte[] receive() throws IOException
+    {
+        int length;
+        byte[] result;
+
+        _socket_.receive(__receivePacket);
+
+        result = new byte[length = __receivePacket.getLength()];
+        System.arraycopy(__receiveData, 0, result, 0, length);
+
+        return result;
+    }
+
+}
+

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java Thu Dec 21 08:28:51 2006
@@ -1,90 +1,92 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.daytime;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import org.apache.commons.net.SocketClient;
-
-/***
- * The DaytimeTCPClient class is a TCP implementation of a client for the
- * Daytime protocol described in RFC 867.  To use the class, merely
- * establish a connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call {@link #getTime  getTime() } to retrieve the daytime
- * string, then
- * call {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to close the connection properly.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see DaytimeUDPClient
- ***/
-
-public final class DaytimeTCPClient extends SocketClient
-{
-    /*** The default daytime port.  It is set to 13 according to RFC 867. ***/
-    public static final int DEFAULT_PORT = 13;
-
-    // Received dates will likely be less than 64 characters.
-    // This is a temporary buffer used while receiving data.
-    private char[] __buffer = new char[64];
-
-    /***
-     * The default DaytimeTCPClient constructor.  It merely sets the default
-     * port to <code> DEFAULT_PORT </code>.
-     ***/
-    public DaytimeTCPClient ()
-    {
-        setDefaultPort(DEFAULT_PORT);
-    }
-
-    /***
-     * Retrieves the time string from the server and returns it.  The
-     * server will have closed the connection at this point, so you should
-     * call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * after calling this method.  To retrieve another time, you must
-     * initiate another connection with
-     * {@link org.apache.commons.net.SocketClient#connect  connect }
-     * before calling <code> getTime() </code> again.
-     * <p>
-     * @return The time string retrieved from the server.
-     * @exception IOException  If an error occurs while fetching the time string.
-     ***/
-    public String getTime() throws IOException
-    {
-        int read;
-        StringBuffer result = new StringBuffer(__buffer.length);
-        BufferedReader reader;
-
-        reader = new BufferedReader(new InputStreamReader(_input_));
-
-        while (true)
-        {
-            read = reader.read(__buffer, 0, __buffer.length);
-            if (read <= 0)
-                break;
-            result.append(__buffer, 0, read);
-        }
-
-        return result.toString();
-    }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.daytime;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.apache.commons.net.SocketClient;
+
+/***
+ * The DaytimeTCPClient class is a TCP implementation of a client for the
+ * Daytime protocol described in RFC 867.  To use the class, merely
+ * establish a connection with
+ * {@link org.apache.commons.net.SocketClient#connect  connect }
+ * and call {@link #getTime  getTime() } to retrieve the daytime
+ * string, then
+ * call {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+ * to close the connection properly.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see DaytimeUDPClient
+ ***/
+
+public final class DaytimeTCPClient extends SocketClient
+{
+    /*** The default daytime port.  It is set to 13 according to RFC 867. ***/
+    public static final int DEFAULT_PORT = 13;
+
+    // Received dates will likely be less than 64 characters.
+    // This is a temporary buffer used while receiving data.
+    private char[] __buffer = new char[64];
+
+    /***
+     * The default DaytimeTCPClient constructor.  It merely sets the default
+     * port to <code> DEFAULT_PORT </code>.
+     ***/
+    public DaytimeTCPClient ()
+    {
+        setDefaultPort(DEFAULT_PORT);
+    }
+
+    /***
+     * Retrieves the time string from the server and returns it.  The
+     * server will have closed the connection at this point, so you should
+     * call
+     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+     * after calling this method.  To retrieve another time, you must
+     * initiate another connection with
+     * {@link org.apache.commons.net.SocketClient#connect  connect }
+     * before calling <code> getTime() </code> again.
+     * <p>
+     * @return The time string retrieved from the server.
+     * @exception IOException  If an error occurs while fetching the time string.
+     ***/
+    public String getTime() throws IOException
+    {
+        int read;
+        StringBuffer result = new StringBuffer(__buffer.length);
+        BufferedReader reader;
+
+        reader = new BufferedReader(new InputStreamReader(_input_));
+
+        while (true)
+        {
+            read = reader.read(__buffer, 0, __buffer.length);
+            if (read <= 0)
+                break;
+            result.append(__buffer, 0, read);
+        }
+
+        return result.toString();
+    }
+
+}
+

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java Thu Dec 21 08:28:51 2006
@@ -1,82 +1,84 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.daytime;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-
-import org.apache.commons.net.DatagramSocketClient;
-
-/***
- * The DaytimeUDPClient class is a UDP implementation of a client for the
- * Daytime protocol described in RFC 867.  To use the class, merely
- * open a local datagram socket with
- * {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #getTime  getTime } to retrieve the daytime
- * string, then
- * call {@link org.apache.commons.net.DatagramSocketClient#close  close }
- * to close the connection properly.  Unlike
- * {@link org.apache.commons.net.daytime.DaytimeTCPClient},
- * successive calls to {@link #getTime  getTime } are permitted
- * without re-establishing a connection.  That is because UDP is a
- * connectionless protocol and the Daytime protocol is stateless.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see DaytimeTCPClient
- ***/
-
-public final class DaytimeUDPClient extends DatagramSocketClient
-{
-    /*** The default daytime port.  It is set to 13 according to RFC 867. ***/
-    public static final int DEFAULT_PORT = 13;
-
-    private byte[] __dummyData = new byte[1];
-    // Received dates should be less than 256 bytes
-    private byte[] __timeData = new byte[256];
-
-    /***
-     * Retrieves the time string from the specified server and port and
-     * returns it.
-     * <p>
-     * @param host The address of the server.
-     * @param port The port of the service.
-     * @return The time string.
-     * @exception IOException If an error occurs while retrieving the time.
-     ***/
-    public String getTime(InetAddress host, int port) throws IOException
-    {
-        DatagramPacket sendPacket, receivePacket;
-
-        sendPacket =
-            new DatagramPacket(__dummyData, __dummyData.length, host, port);
-        receivePacket = new DatagramPacket(__timeData, __timeData.length);
-
-        _socket_.send(sendPacket);
-        _socket_.receive(receivePacket);
-
-        return new String(receivePacket.getData(), 0, receivePacket.getLength());
-    }
-
-    /*** Same as <code>getTime(host, DaytimeUDPClient.DEFAULT_PORT);</code> ***/
-    public String getTime(InetAddress host) throws IOException
-    {
-        return getTime(host, DEFAULT_PORT);
-    }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.daytime;
+
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.InetAddress;
+
+import org.apache.commons.net.DatagramSocketClient;
+
+/***
+ * The DaytimeUDPClient class is a UDP implementation of a client for the
+ * Daytime protocol described in RFC 867.  To use the class, merely
+ * open a local datagram socket with
+ * {@link org.apache.commons.net.DatagramSocketClient#open  open }
+ * and call {@link #getTime  getTime } to retrieve the daytime
+ * string, then
+ * call {@link org.apache.commons.net.DatagramSocketClient#close  close }
+ * to close the connection properly.  Unlike
+ * {@link org.apache.commons.net.daytime.DaytimeTCPClient},
+ * successive calls to {@link #getTime  getTime } are permitted
+ * without re-establishing a connection.  That is because UDP is a
+ * connectionless protocol and the Daytime protocol is stateless.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see DaytimeTCPClient
+ ***/
+
+public final class DaytimeUDPClient extends DatagramSocketClient
+{
+    /*** The default daytime port.  It is set to 13 according to RFC 867. ***/
+    public static final int DEFAULT_PORT = 13;
+
+    private byte[] __dummyData = new byte[1];
+    // Received dates should be less than 256 bytes
+    private byte[] __timeData = new byte[256];
+
+    /***
+     * Retrieves the time string from the specified server and port and
+     * returns it.
+     * <p>
+     * @param host The address of the server.
+     * @param port The port of the service.
+     * @return The time string.
+     * @exception IOException If an error occurs while retrieving the time.
+     ***/
+    public String getTime(InetAddress host, int port) throws IOException
+    {
+        DatagramPacket sendPacket, receivePacket;
+
+        sendPacket =
+            new DatagramPacket(__dummyData, __dummyData.length, host, port);
+        receivePacket = new DatagramPacket(__timeData, __timeData.length);
+
+        _socket_.send(sendPacket);
+        _socket_.receive(receivePacket);
+
+        return new String(receivePacket.getData(), 0, receivePacket.getLength());
+    }
+
+    /*** Same as <code>getTime(host, DaytimeUDPClient.DEFAULT_PORT);</code> ***/
+    public String getTime(InetAddress host) throws IOException
+    {
+        return getTime(host, DEFAULT_PORT);
+    }
+
+}
+

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/discard/DiscardTCPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/discard/DiscardTCPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/discard/DiscardTCPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/discard/DiscardTCPClient.java Thu Dec 21 08:28:51 2006
@@ -1,65 +1,67 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.discard;
-
-import java.io.OutputStream;
-
-import org.apache.commons.net.SocketClient;
-
-/***
- * The DiscardTCPClient class is a TCP implementation of a client for the
- * Discard protocol described in RFC 863.  To use the class, merely
- * establish a connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call {@link #getOutputStream  getOutputStream() } to
- * retrieve the discard output stream.  Don't close the output stream
- * when you're done writing to it.  Rather, call
- * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to clean up properly.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see DiscardUDPClient
- ***/
-
-public class DiscardTCPClient extends SocketClient
-{
-    /*** The default discard port.  It is set to 9 according to RFC 863. ***/
-    public static final int DEFAULT_PORT = 9;
-
-    /***
-     * The default DiscardTCPClient constructor.  It merely sets the default
-     * port to <code> DEFAULT_PORT </code>.
-     ***/
-    public DiscardTCPClient ()
-    {
-        setDefaultPort(DEFAULT_PORT);
-    }
-
-    /***
-     * Returns an OutputStream through which you may write data to the server.
-     * You should NOT close the OutputStream when you're finished
-     * reading from it.  Rather, you should call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * to clean up properly.
-     * <p>
-     * @return An OutputStream through which you can write data to the server.
-     ***/
-    public OutputStream getOutputStream()
-    {
-        return _output_;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.discard;
+
+import java.io.OutputStream;
+
+import org.apache.commons.net.SocketClient;
+
+/***
+ * The DiscardTCPClient class is a TCP implementation of a client for the
+ * Discard protocol described in RFC 863.  To use the class, merely
+ * establish a connection with
+ * {@link org.apache.commons.net.SocketClient#connect  connect }
+ * and call {@link #getOutputStream  getOutputStream() } to
+ * retrieve the discard output stream.  Don't close the output stream
+ * when you're done writing to it.  Rather, call
+ * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+ * to clean up properly.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see DiscardUDPClient
+ ***/
+
+public class DiscardTCPClient extends SocketClient
+{
+    /*** The default discard port.  It is set to 9 according to RFC 863. ***/
+    public static final int DEFAULT_PORT = 9;
+
+    /***
+     * The default DiscardTCPClient constructor.  It merely sets the default
+     * port to <code> DEFAULT_PORT </code>.
+     ***/
+    public DiscardTCPClient ()
+    {
+        setDefaultPort(DEFAULT_PORT);
+    }
+
+    /***
+     * Returns an OutputStream through which you may write data to the server.
+     * You should NOT close the OutputStream when you're finished
+     * reading from it.  Rather, you should call
+     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+     * to clean up properly.
+     * <p>
+     * @return An OutputStream through which you can write data to the server.
+     ***/
+    public OutputStream getOutputStream()
+    {
+        return _output_;
+    }
+}

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/discard/DiscardUDPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/discard/DiscardUDPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/discard/DiscardUDPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/discard/DiscardUDPClient.java Thu Dec 21 08:28:51 2006
@@ -1,95 +1,97 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.discard;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-
-import org.apache.commons.net.DatagramSocketClient;
-
-/***
- * The DiscardUDPClient class is a UDP implementation of a client for the
- * Discard protocol described in RFC 863.  To use the class,
- * just open a local UDP port
- * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #send  send } to send datagrams to the server
- * After you're done sending discard data, call
- * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
- * to clean up properly.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see DiscardTCPClient
- ***/
-
-public class DiscardUDPClient extends DatagramSocketClient
-{
-    /*** The default discard port.  It is set to 9 according to RFC 863. ***/
-    public static final int DEFAULT_PORT = 9;
-
-    DatagramPacket _sendPacket;
-
-    public DiscardUDPClient()
-    {
-        _sendPacket = new DatagramPacket(new byte[0], 0);
-    }
-
-
-    /***
-     * Sends the specified data to the specified server at the specified port.
-     * <p>
-     * @param data  The discard data to send.
-     * @param length  The length of the data to send.  Should be less than
-     *    or equal to the length of the data byte array.
-     * @param host  The address of the server.
-     * @param port  The service port.
-     * @exception IOException If an error occurs during the datagram send
-     *            operation.
-     ***/
-    public void send(byte[] data, int length, InetAddress host, int port)
-    throws IOException
-    {
-        _sendPacket.setData(data);
-        _sendPacket.setLength(length);
-        _sendPacket.setAddress(host);
-        _sendPacket.setPort(port);
-        _socket_.send(_sendPacket);
-    }
-
-
-    /***
-     * Same as
-     * <code>send(data, length, host. DiscardUDPClient.DEFAULT_PORT)</code>.
-     ***/
-    public void send(byte[] data, int length, InetAddress host)
-    throws IOException
-    {
-        send(data, length, host, DEFAULT_PORT);
-    }
-
-
-    /***
-     * Same as
-     * <code>send(data, data.length, host. DiscardUDPClient.DEFAULT_PORT)</code>.
-     ***/
-    public void send(byte[] data, InetAddress host) throws IOException
-    {
-        send(data, data.length, host, DEFAULT_PORT);
-    }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.discard;
+
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.InetAddress;
+
+import org.apache.commons.net.DatagramSocketClient;
+
+/***
+ * The DiscardUDPClient class is a UDP implementation of a client for the
+ * Discard protocol described in RFC 863.  To use the class,
+ * just open a local UDP port
+ * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
+ * and call {@link #send  send } to send datagrams to the server
+ * After you're done sending discard data, call
+ * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
+ * to clean up properly.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see DiscardTCPClient
+ ***/
+
+public class DiscardUDPClient extends DatagramSocketClient
+{
+    /*** The default discard port.  It is set to 9 according to RFC 863. ***/
+    public static final int DEFAULT_PORT = 9;
+
+    DatagramPacket _sendPacket;
+
+    public DiscardUDPClient()
+    {
+        _sendPacket = new DatagramPacket(new byte[0], 0);
+    }
+
+
+    /***
+     * Sends the specified data to the specified server at the specified port.
+     * <p>
+     * @param data  The discard data to send.
+     * @param length  The length of the data to send.  Should be less than
+     *    or equal to the length of the data byte array.
+     * @param host  The address of the server.
+     * @param port  The service port.
+     * @exception IOException If an error occurs during the datagram send
+     *            operation.
+     ***/
+    public void send(byte[] data, int length, InetAddress host, int port)
+    throws IOException
+    {
+        _sendPacket.setData(data);
+        _sendPacket.setLength(length);
+        _sendPacket.setAddress(host);
+        _sendPacket.setPort(port);
+        _socket_.send(_sendPacket);
+    }
+
+
+    /***
+     * Same as
+     * <code>send(data, length, host. DiscardUDPClient.DEFAULT_PORT)</code>.
+     ***/
+    public void send(byte[] data, int length, InetAddress host)
+    throws IOException
+    {
+        send(data, length, host, DEFAULT_PORT);
+    }
+
+
+    /***
+     * Same as
+     * <code>send(data, data.length, host. DiscardUDPClient.DEFAULT_PORT)</code>.
+     ***/
+    public void send(byte[] data, InetAddress host) throws IOException
+    {
+        send(data, data.length, host, DEFAULT_PORT);
+    }
+
+}
+

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/echo/EchoTCPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/echo/EchoTCPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/echo/EchoTCPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/echo/EchoTCPClient.java Thu Dec 21 08:28:51 2006
@@ -1,71 +1,73 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.echo;
-
-import java.io.InputStream;
-
-import org.apache.commons.net.SocketClient;
-import org.apache.commons.net.discard.DiscardTCPClient;
-
-/***
- * The EchoTCPClient class is a TCP implementation of a client for the
- * Echo protocol described in RFC 862.  To use the class, merely
- * establish a connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call {@link DiscardTCPClient#getOutputStream  getOutputStream() } to
- * retrieve the echo output stream and
- * {@link #getInputStream getInputStream() }
- *  to get the echo input stream.
- * Don't close either stream when you're done using them.  Rather, call
- * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to clean up properly.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see EchoUDPClient
- * @see DiscardTCPClient
- ***/
-
-public final class EchoTCPClient extends DiscardTCPClient
-{
-    /*** The default echo port.  It is set to 7 according to RFC 862. ***/
-    public static final int DEFAULT_PORT = 7;
-
-    /***
-     * The default EchoTCPClient constructor.  It merely sets the default
-     * port to <code> DEFAULT_PORT </code>.
-     ***/
-    public EchoTCPClient ()
-    {
-        setDefaultPort(DEFAULT_PORT);
-    }
-
-    /***
-     * Returns an InputStream from which you may read echoed data from
-     * the server.  You should NOT close the InputStream when you're finished
-     * reading from it.  Rather, you should call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * to clean up properly.
-     * <p>
-     * @return An InputStream from which you can read echoed data from the
-     *         server.
-     ***/
-    public InputStream getInputStream()
-    {
-        return _input_;
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.echo;
+
+import java.io.InputStream;
+
+import org.apache.commons.net.SocketClient;
+import org.apache.commons.net.discard.DiscardTCPClient;
+
+/***
+ * The EchoTCPClient class is a TCP implementation of a client for the
+ * Echo protocol described in RFC 862.  To use the class, merely
+ * establish a connection with
+ * {@link org.apache.commons.net.SocketClient#connect  connect }
+ * and call {@link DiscardTCPClient#getOutputStream  getOutputStream() } to
+ * retrieve the echo output stream and
+ * {@link #getInputStream getInputStream() }
+ *  to get the echo input stream.
+ * Don't close either stream when you're done using them.  Rather, call
+ * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+ * to clean up properly.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see EchoUDPClient
+ * @see DiscardTCPClient
+ ***/
+
+public final class EchoTCPClient extends DiscardTCPClient
+{
+    /*** The default echo port.  It is set to 7 according to RFC 862. ***/
+    public static final int DEFAULT_PORT = 7;
+
+    /***
+     * The default EchoTCPClient constructor.  It merely sets the default
+     * port to <code> DEFAULT_PORT </code>.
+     ***/
+    public EchoTCPClient ()
+    {
+        setDefaultPort(DEFAULT_PORT);
+    }
+
+    /***
+     * Returns an InputStream from which you may read echoed data from
+     * the server.  You should NOT close the InputStream when you're finished
+     * reading from it.  Rather, you should call
+     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+     * to clean up properly.
+     * <p>
+     * @return An InputStream from which you can read echoed data from the
+     *         server.
+     ***/
+    public InputStream getInputStream()
+    {
+        return _input_;
+    }
+
+}

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java Thu Dec 21 08:28:51 2006
@@ -1,98 +1,100 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.echo;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-
-import org.apache.commons.net.DatagramSocketClient;
-import org.apache.commons.net.discard.DiscardUDPClient;
-
-/***
- * The EchoUDPClient class is a UDP implementation of a client for the
- * Echo protocol described in RFC 862.  To use the class,
- * just open a local UDP port
- * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #send  send } to send datagrams to the server,
- * then call {@link #receive  receive } to receive echoes.
- * After you're done echoing data, call
- * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
- * to clean up properly.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see EchoTCPClient
- * @see DiscardUDPClient
- ***/
-
-public final class EchoUDPClient extends DiscardUDPClient
-{
-    /*** The default echo port.  It is set to 7 according to RFC 862. ***/
-    public static final int DEFAULT_PORT = 7;
-
-    private DatagramPacket __receivePacket = new DatagramPacket(new byte[0], 0);
-
-    /***
-     * Sends the specified data to the specified server at the default echo
-     * port.
-     * <p>
-     * @param data  The echo data to send.
-     * @param length  The length of the data to send.  Should be less than
-     *    or equal to the length of the data byte array.
-     * @param host  The address of the server.
-     * @exception IOException If an error occurs during the datagram send
-     *     operation.
-     ***/
-    public void send(byte[] data, int length, InetAddress host)
-    throws IOException
-    {
-        send(data, length, host, DEFAULT_PORT);
-    }
-
-
-    /*** Same as <code> send(data, data.length, host) </code> ***/
-    public void send(byte[] data, InetAddress host) throws IOException
-    {
-        send(data, data.length, host, DEFAULT_PORT);
-    }
-
-
-    /***
-     * Receives echoed data and returns its length.  The data may be divided
-     * up among multiple datagrams, requiring multiple calls to receive.
-     * Also, the UDP packets will not necessarily arrive in the same order
-     * they were sent.
-     * <p>
-     * @return  Length of actual data received.
-     * @exception IOException If an error occurs while receiving the data.
-     ***/
-    public int receive(byte[] data, int length) throws IOException
-    {
-        __receivePacket.setData(data);
-        __receivePacket.setLength(length);
-        _socket_.receive(__receivePacket);
-        return __receivePacket.getLength();
-    }
-
-    /*** Same as <code> receive(data, data.length)</code> ***/
-    public int receive(byte[] data) throws IOException
-    {
-        return receive(data, data.length);
-    }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.echo;
+
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.InetAddress;
+
+import org.apache.commons.net.DatagramSocketClient;
+import org.apache.commons.net.discard.DiscardUDPClient;
+
+/***
+ * The EchoUDPClient class is a UDP implementation of a client for the
+ * Echo protocol described in RFC 862.  To use the class,
+ * just open a local UDP port
+ * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
+ * and call {@link #send  send } to send datagrams to the server,
+ * then call {@link #receive  receive } to receive echoes.
+ * After you're done echoing data, call
+ * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
+ * to clean up properly.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see EchoTCPClient
+ * @see DiscardUDPClient
+ ***/
+
+public final class EchoUDPClient extends DiscardUDPClient
+{
+    /*** The default echo port.  It is set to 7 according to RFC 862. ***/
+    public static final int DEFAULT_PORT = 7;
+
+    private DatagramPacket __receivePacket = new DatagramPacket(new byte[0], 0);
+
+    /***
+     * Sends the specified data to the specified server at the default echo
+     * port.
+     * <p>
+     * @param data  The echo data to send.
+     * @param length  The length of the data to send.  Should be less than
+     *    or equal to the length of the data byte array.
+     * @param host  The address of the server.
+     * @exception IOException If an error occurs during the datagram send
+     *     operation.
+     ***/
+    public void send(byte[] data, int length, InetAddress host)
+    throws IOException
+    {
+        send(data, length, host, DEFAULT_PORT);
+    }
+
+
+    /*** Same as <code> send(data, data.length, host) </code> ***/
+    public void send(byte[] data, InetAddress host) throws IOException
+    {
+        send(data, data.length, host, DEFAULT_PORT);
+    }
+
+
+    /***
+     * Receives echoed data and returns its length.  The data may be divided
+     * up among multiple datagrams, requiring multiple calls to receive.
+     * Also, the UDP packets will not necessarily arrive in the same order
+     * they were sent.
+     * <p>
+     * @return  Length of actual data received.
+     * @exception IOException If an error occurs while receiving the data.
+     ***/
+    public int receive(byte[] data, int length) throws IOException
+    {
+        __receivePacket.setData(data);
+        __receivePacket.setLength(length);
+        _socket_.receive(__receivePacket);
+        return __receivePacket.getLength();
+    }
+
+    /*** Same as <code> receive(data, data.length)</code> ***/
+    public int receive(byte[] data) throws IOException
+    {
+        return receive(data, data.length);
+    }
+
+}
+



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message