创建FTP的会话ID和计时器 [英] Create Session-ID and Timer for FTP

查看:152
本文介绍了创建FTP的会话ID和计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在编写代码以实现FTP Client-Server,其中包含用于
的方法 1.客户端用户名密码验证.
2.下载文件.
3.上传文件.

现在,我的代码应该工作的步骤是:
A.服务器将用户名-密码对保留在内存中.
B.每个用户名都与服务器中与之不同的文件夹/路径相关联
可以访问.
C.服务器将用户名-路径对保留在内存中.
D.验证用户名后,服务器将创建一个会话ID为
与特定客户相关联.
E.服务器将创建一个计时器,该计时器将在每次客户端请求
时进行更新 如果最后1个计时器尚未更新,则服务器OR将删除会话ID.
小时.

所以我的问题是:有人可以帮我解决D点和E点吗?

Hi All,
I am writing a code to implement FTP Client-Server which have the methods for
1. Client Username-Password Authentication.
2. Downloading A File.
3. Uploading A File.

Now the steps in which my code should work is:
A. Server keeps in memory the Username-Password Pair.
B. Each Username is associated with a different folder/path in server from where it
have access.
C. Server keeps in memory the Username-Path Pair.
D. After authentication of a Username, Server will create a Session-ID to be
associated with the specific Client.
E. Server will create a timer which will be updated each time the client requests the
server OR will delete the Session-ID if timer have not been updated for last 1
Hour.

So my question is: Can anybody help me with points D and E please.

推荐答案

我认为您不需要为此创建任何会话ID.在http协议会话中,识别用户很重要.在服务器和客户端之间传输数据后,导致连接终止.但是,如果FTP收到客户端的退出请求,则会关闭其连接.

但是,如果您要启用计时问题,则它是一个不同的问题.通过计时,我的意思是断开不活动的用户"

您应该查看选择 [
I dont think you need to create any session id for this. in http protocol session is important to identify the user. cause after transferring data between server and client the connection is terminated. but in case FTP it close its connection when it get an exit request from client.

But if you want to enable timing issue then its a different issue. By timing i mean ''Disconnection inactive user''

you should take a look at select[^] function can disconnect at in active user


这篇关于创建FTP的会话ID和计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆