用socket實現的檔案伺服器 2

2021-04-01 20:19:28 字數 1598 閱讀 7331

/**

* 業務邏輯層呼叫的介面

* @author hongsoft

*/public class forumfiledao

catch (exception e)

ffc.closesocket();

return content;

}/**

* 得到回帖列表

* @param forumid

* @param topicid

* @return

*/public static list getreplycontent(int forumid, int topicid)

}catch (exception e)

ffc.closesocket();

return replylist;

}/**

* 發帖

* @param forumid

* @param topicid

* @return

*/public static void addtopic(int forumid, int topicid,string content)

catch (exception e)

ffc.closesocket();     

}/**

* 續貼(主題貼只寫一行)

* @param forumid

* @param topicid

* @return

*/public static void resumetopic(int forumid, int topicid,string content)

catch (exception e)

ffc.closesocket();     

}/**

* 回貼

* @param forumid

* @param topicid

* @return

*/public static void addreply(int forumid, int topicid,string content,string qq,string replytime)

catch (exception e)

ffc.closesocket();     

}/**

* 刪主題貼(同時它的回貼也應該刪除)

* @param forumid

* @param topicid

* @return

*/public static void deletetopic(int forumid, int topicid)

catch (exception e)

ffc.closesocket();     

}/**

* 刪某個回貼(但回貼數並不做改變)

* @param forumid

* @param topicid

* @return

*/public static void deletereply(int forumid, int topicid,int replyid)

catch (exception e)

ffc.closesocket();      }}

用socket實現的檔案伺服器 5

資料包內容解析 author hongsoft public class packetparserthread extends thread public void run else catch ioexception e finally catch ioexception e 中間全部用ox1e分...

用socket實現的檔案伺服器 3

主題帖cache規則 讀則加入,否則不需要加入 private static cache topiccache new cache 300 1000 1000 回帖cache private static cache replycache new cache 300 1000 1000 取主題貼,首...

用socket實現的檔案伺服器 1

public class forumfileclient catch exception e private socket socket private bufferedreader in private printwriter out public forumfileclient catch ex...

用socket實現的檔案伺服器 3

主題帖cache規則 讀則加入,否則不需要加入 private static cache topiccache new cache 300 1000 1000 回帖cache private static cache replycache new cache 300 1000 1000 取主題貼,首...

用socket實現的檔案伺服器 5

資料包內容解析 author hongsoft public class packetparserthread extends thread public void run else catch ioexception e finally catch ioexception e 中間全部用ox1e分...