[Udt-java-commits] SF.net SVN: udt-java:[20] udt-java/trunk/src
Status: Alpha
Brought to you by:
bschuller
|
From: <bsc...@us...> - 2010-04-20 21:21:21
|
Revision: 20
http://udt-java.svn.sourceforge.net/udt-java/?rev=20&view=rev
Author: bschuller
Date: 2010-04-20 21:21:15 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
disable connection expiry
Modified Paths:
--------------
udt-java/trunk/src/main/java/udt/UDTReceiver.java
udt-java/trunk/src/main/java/udt/util/ReceiveFile.java
udt-java/trunk/src/main/java/udt/util/SendFile.java
udt-java/trunk/src/test/java/udt/TestSendFileReceiveFile.java
Modified: udt-java/trunk/src/main/java/udt/UDTReceiver.java
===================================================================
--- udt-java/trunk/src/main/java/udt/UDTReceiver.java 2010-04-20 20:17:07 UTC (rev 19)
+++ udt-java/trunk/src/main/java/udt/UDTReceiver.java 2010-04-20 21:21:15 UTC (rev 20)
@@ -125,7 +125,7 @@
private long nextEXP;
//microseconds to next EXP event
- private long EXP_INTERVAL=2*Util.getSYNTime();
+ private long EXP_INTERVAL=10*Util.getSYNTime();
//buffer size for storing data
private final long bufferSize;
@@ -513,7 +513,6 @@
}
public void stop()throws IOException{
- System.out.println("STOP");
stopped=true;
session.getSocket().close();
//stop our sender as well
Modified: udt-java/trunk/src/main/java/udt/util/ReceiveFile.java
===================================================================
--- udt-java/trunk/src/main/java/udt/util/ReceiveFile.java 2010-04-20 20:17:07 UTC (rev 19)
+++ udt-java/trunk/src/main/java/udt/util/ReceiveFile.java 2010-04-20 21:21:15 UTC (rev 20)
@@ -40,6 +40,7 @@
import udt.UDTClient;
import udt.UDTInputStream;
import udt.UDTOutputStream;
+import udt.UDTReceiver;
/**
* helper class for receiving a single file via UDT
@@ -66,6 +67,7 @@
public void run(){
configure();
try{
+ UDTReceiver.connectionExpiryDisabled=true;
InetAddress myHost=localIP!=null?InetAddress.getByName(localIP):InetAddress.getLocalHost();
UDTClient client=localPort!=-1?new UDTClient(myHost,localPort):new UDTClient(myHost);
client.connect(serverHost, serverPort);
Modified: udt-java/trunk/src/main/java/udt/util/SendFile.java
===================================================================
--- udt-java/trunk/src/main/java/udt/util/SendFile.java 2010-04-20 20:17:07 UTC (rev 19)
+++ udt-java/trunk/src/main/java/udt/util/SendFile.java 2010-04-20 21:21:15 UTC (rev 20)
@@ -42,6 +42,7 @@
import udt.UDTInputStream;
import udt.UDTOutputStream;
+import udt.UDTReceiver;
import udt.UDTServerSocket;
import udt.UDTSocket;
import udt.packets.PacketUtil;
@@ -72,6 +73,7 @@
public void run(){
configure();
try{
+ UDTReceiver.connectionExpiryDisabled=true;
InetAddress myHost=localIP!=null?InetAddress.getByName(localIP):InetAddress.getLocalHost();
UDTServerSocket server=new UDTServerSocket(myHost,serverPort);
while(true){
@@ -134,7 +136,7 @@
bb.get(fileName);
File file=new File(new String(fileName));
- System.out.println("[SendFile] File requested: "+file.getPath());
+ System.out.println("[SendFile] File requested: '"+file.getPath()+"'");
FileInputStream fis=new FileInputStream(file);
try{
Modified: udt-java/trunk/src/test/java/udt/TestSendFileReceiveFile.java
===================================================================
--- udt-java/trunk/src/test/java/udt/TestSendFileReceiveFile.java 2010-04-20 20:17:07 UTC (rev 19)
+++ udt-java/trunk/src/test/java/udt/TestSendFileReceiveFile.java 2010-04-20 21:21:15 UTC (rev 20)
@@ -13,7 +13,10 @@
public void test1()throws Exception{
runServer();
- while(!serverStarted)Thread.sleep(100);
+ do{
+ Thread.sleep(500);
+ }while(!serverStarted);
+
File f=new File("src/test/java/datafile");
File tmp=File.createTempFile("udtest-", null);
@@ -28,9 +31,9 @@
private void runServer(){
Runnable r=new Runnable(){
public void run(){
- serverStarted=true;
String []args=new String[]{"65321"};
try{
+ serverStarted=true;
SendFile.main(args);
}catch(Exception ex){
ex.printStackTrace();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|