|
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.FileSender
public class FileSender
file sender class 文件发送类
| Field Summary | |
|---|---|
protected FragmentBuffer |
fb
|
protected HeartBeatThread |
hbThread
|
| 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 | |
|---|---|
FileSender()
|
|
| Method Summary | |
|---|---|
void |
abort()
abort file transfer 取消文件传输 |
void |
finish()
finish file transfer, process some post event 结束文件传输,处理一些善后事宜 |
void |
initFragmentBuffer(RandomAccessFile file,
int size,
int fz,
int max)
init fragment buffer 初始化分片缓冲区 |
boolean |
isSuspend()
|
boolean |
openLocalFile()
open local file to read 打开本地文件准备读 |
void |
run()
|
protected void |
sayHello(FileControlPacket fcp,
ByteBuffer buffer)
say hello |
void |
send()
send buffer content of sender 发送sender的buffer内容 |
void |
send(ByteBuffer buffer)
send content of buffer 发送buffer中的内容 |
protected void |
sendBasic(FileDataPacket fdp,
ByteBuffer buffer)
send file basic info 发送文件基本信息 |
protected void |
sendEOF(FileDataPacket fdp,
ByteBuffer buffer)
send file EOF info 发送文件EOF信息 |
protected void |
sendFinish(FileDataPacket fdp,
ByteBuffer buffer)
send transfer over info 发送传输结束信息 |
protected void |
sendFragment(FileDataPacket fdp,
ByteBuffer buffer)
fragment which still doesn't get ACK in send window 发送窗口中还没有收到确认的分片 |
protected void |
sendHeartBeat(FileDataPacket fdp,
ByteBuffer buffer,
char seq)
send heart beat 发送heart beat |
void |
sendInitConnectionToDirect()
send init connection packet direct to direct port of the other side 往对方直接端口发送Init Connection包 |
void |
setSuspend(boolean suspend)
|
void |
shutdown()
close watcher 关闭守望者 |
void |
start()
start watcher, for receiver, he will choose a link to transfer for sender, he will start two port waiting for reply by the other side 启动守望者,对于接收者,他将选择一条链路进行连接准备传输 对于发送者,他将启动两个端口等待对方应答 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected FragmentBuffer fb
protected HeartBeatThread hbThread
| Constructor Detail |
|---|
public FileSender()
client - | Method Detail |
|---|
public boolean openLocalFile()
openLocalFile in class FileWatcherpublic void shutdown()
FileWatcher
shutdown in class FileWatcherpublic void abort()
FileWatcher
abort in class FileWatcherpublic void run()
run in interface Runnablepublic void sendInitConnectionToDirect()
public void finish()
FileWatcher
finish in class FileWatcherpublic void start()
FileWatcherstart watcher, for receiver, he will choose a link to transfer for sender, he will start two port waiting for reply by the other side 启动守望者,对于接收者,他将选择一条链路进行连接准备传输 对于发送者,他将启动两个端口等待对方应答
start in class FileWatcher
public void initFragmentBuffer(RandomAccessFile file,
int size,
int fz,
int max)
file - RandomAccessFile对象 // RandomAccessFile objectsize - buffer大小 // buffer sizefz - 分片大小 // fragment sizemax - 文件最大的分片序号 //sequence number of biggest fragment of filepublic void send()
public void send(ByteBuffer buffer)
protected void sendHeartBeat(FileDataPacket fdp,
ByteBuffer buffer,
char seq)
seq - 序号 //sequence number
protected void sayHello(FileControlPacket fcp,
ByteBuffer buffer)
protected void sendFragment(FileDataPacket fdp,
ByteBuffer buffer)
protected void sendEOF(FileDataPacket fdp,
ByteBuffer buffer)
protected void sendBasic(FileDataPacket fdp,
ByteBuffer buffer)
protected void sendFinish(FileDataPacket fdp,
ByteBuffer buffer)
public boolean isSuspend()
public void setSuspend(boolean suspend)
suspend - The suspend to set.
|
JML | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||