program about scoket

来源:互联网 发布:java httpheaders 编辑:程序博客网 时间:2024/05/22 01:42

关于TCP/IP客户端和服务器的程序.
my code  can run ok in VC6.0,but when I replant it to VS2005,happen the question without rhyme or reason.It run in the position of Achieve::ReadString and stop for a long time.I analyse my code and at last doubt code format question.I do my best to solve it  but don't find any way.I busy in the whole day and don't solve it.finally,please google to help me.modify VS2005 code configuration,sustain UNICODE at default situation.let it sustain any format.I had solved this question but spent the whole day on the qestion.do you think it is a worthy thing?thank you!
use CSocket ,CSocketFile and CAchieve.
new CSocket object m_socket
m_socket->create();
m_socket-> connect(serverName,port);
new CSocketFile(m_socket) object m_socketFile
new CAchieve(m_socketFile,CAchieve::load);m_loadAchieve
new CAchieve(m_socketFile,CAchieve::store);m_storeAchieve
m_storeAchieve store the command and send it to the serve.clear m_storeAchieve.
m_loadAchieve get feedback from the server.

CAsyncSocket don't sustain SOCK_STREAM.SOCKET_STREAM is TCP and SOCK_DGRAM is UDP.
TCP send data to server and wait for server.if server give a true feedback and continne transforming data.else retransform.it is used if data transform very correctly.
UDP don't wait for the server.
I conside it also be the code format question. 
CAsyncSocket new object, create it and connect to the serve.rewrite OnReceive function and get the feedback message. 

use CFtpConnection and CInternetSession,我写过一个ftp上传进度控制。通过一个2M的共享空间控制

GetFtpDirectory  是验证你新创建的路径是否正确!

CFtpFileFind 之前需要确定ftp的路径,SetFtpDirectory