|
JML | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jqql.obsolete.FileWatcher
net.sf.jqql.obsolete.FileReceiver
public class FileReceiver
file receiver class 文件接收类
| Field Summary |
|---|
| Fields inherited from class net.sf.jqql.obsolete.FileWatcher |
|---|
buffer, condition, fcp, fdp, fileAgentKey, fileAgentToken, fileMD5, fileName, fileNameMD5, fileSize, fileTransferStatus, fragments, FT_NEGOTIATING, FT_NONE, FT_RECEIVING, FT_SAYING_HELLO, FT_SENDING, FT_SENDING_BASIC, FT_SENDING_EOF, hisFileSessionKey, hisInternetIp, hisInternetPort, hisLocalIp, hisMajorPort, hisMinorPort, hisQQ, listeners, localFile, localFileName, log, major, maxFragmentSize, monitor, myFace, myFileSessionKey, myInternetIp, myInternetPort, myLocalIp, myMajorPort, myMinorPort, myQQ, selector, sessionSequence, shutdown, useUdp, window |
| Constructor Summary | |
|---|---|
FileReceiver()
|
|
| Method Summary | |
|---|---|
void |
abort()
cancel transfers in the middle of file transfers 在文件传输的中间取消掉传输 |
void |
finish()
after transfer complete, do some post event 在传输完成后做一些善后工作 |
void |
notifyNATPort()
first connect the opposite side, cause this method would be use in another thread, so not use local variable for * fear clash 首先连接对方,由于这个方法会在另外一个线程中被调用,所以不使用本地的变量以免冲突 |
boolean |
openLocalFile()
open local file to write 打开本地文件准备写 |
void |
run()
|
void |
saveFragment(byte[] buf,
int from,
int len,
long offset)
write fragment data to file 写入分片数据到文件中 |
void |
saveFragment(byte[] buf,
long offset)
write fragment data to file 写入分片数据到文件中 |
void |
selectPort()
choose a link to rransfers 选择一条链路进行传输 |
void |
send()
send content of ByteBuffer 发送ByteBuffer中的内容 |
void |
send(ByteBuffer buffer)
send content of appointed buffer 发送指定buffer中的内容 |
void |
shutdown()
close watcher 关闭守望者 |
void |
start()
base on sender and receiver, choose a connect form to start init 根据发送和接收者的情况,选择一种连接方式开始初始化 |
void |
startMajorPort()
start listener of major port 启动直接端口的监听 |
void |
startMinorPort()
start receive sent in local port 开始在本地端口接收发送 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileReceiver()
client - | Method Detail |
|---|
public void start()
start in class FileWatcherpublic void selectPort()
public void startMajorPort()
public void startMinorPort()
public void run()
run in interface Runnablepublic void shutdown()
shutdown in class FileWatcherpublic void abort()
abort in class FileWatcherpublic void finish()
finish in class FileWatcher
public void saveFragment(byte[] buf,
long offset)
buf - 数据缓冲 // data bufferoffset - 数据在实际文件中的绝对偏移 // absolute offset of data in factual file
public void saveFragment(byte[] buf,
int from,
int len,
long offset)
buf - 包含数据的缓冲区 // data bufferfrom - 从缓冲区的from位置开始为分片数据 // from from position of buffer is fragment datalen - 从缓冲区的from位置开始的len字节为分片数据 // len byte from from positio is fragment dataoffset - 这段分片在实际文件中的绝对偏移 // absolute offset of fragment in factual filepublic boolean openLocalFile()
openLocalFile in class FileWatcherpublic void send()
public void send(ByteBuffer buffer)
buffer - public void notifyNATPort()
|
JML | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||