Redian新闻
>
HELP needed--FTP client programming
avatar
kb
2
HELP!!!
I am writting a FTP client program at UNIX
environment--Solaris 8, and I have a big problem now.
Here is what I had done:
I have build the control connection at port 21.(Using
socket, connect,read,write, etc)
I send a "PASV" command through control connection.(Using
write.)
I built the data connection according the response of PASV
command--the six numbers.(
*********part of my code************
data = socket(AF_INET, SOCK_STREAM, 0);
data_addr.sin_family = AF_INET;
avatar
d*y
3
挺可爱啊!
avatar
m*m
4

For one thing, read returns an "int" not a pointer. You
should compare it with 0.
You should check if n < 0 for any possible errors too.
You'd better use select() instead of keep polling with
read().

【在 kb 的大作中提到】
: HELP!!!
: I am writting a FTP client program at UNIX
: environment--Solaris 8, and I have a big problem now.
: Here is what I had done:
: I have build the control connection at port 21.(Using
: socket, connect,read,write, etc)
: I send a "PASV" command through control connection.(Using
: write.)
: I built the data connection according the response of PASV
: command--the six numbers.(

avatar
L*y
5
比google强多了
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。