You listen if you are the server. You connect if you are the client.

I think that you want to connect to an FTP server to initiate connection. Not wait for someone to connect to you.

Alexandre Barreto wrote:

I'm making a ftp program
i saw some exemples of netlib and everthing is going fine untill i got to the datasocket
i need to make it listen...so the ftp server can conect on it. after a i send a PORT command


but when i call NetLibSocketListen i get a -1 and errP says the erro is netErrParamErr
can anyone help me on this?
thnx


here is the source


NetSocketAddrINType A; Err errP; long timeout = SysTicksPerSecond()*25; char *novaopcao; char ip[16];


DataSock=NetLibSocketOpen(libRefnum,netSocketAddrINET, netSocketTypeStream,netSocketProtoIPTCP, timeout, &errP);
if(DataSock < -1){
if(errP == netErrParamErr) WinDrawChars("Erro 2",6,5,135);
if(errP == netErrNotOpen) WinDrawChars("Erro 3",6,5,135);
if(errP == netErrNoMoreSockets) WinDrawChars("Erro 4",6,5,135);
if(errP == netErrOutOfCmdBlocks) WinDrawChars("Erro 5",6,5,135);
if(errP == netErrOutOfMemory) WinDrawChars("Erro 6",6,5,135);
}


if(NetLibSocketOptionSet (libRefnum,DataSock, netSocketOptLevelSocket, netSocketOptSockKeepAlive,novaopcao, sizeof(novaopcao),timeout, &errP)<-1){
WinDrawChars("Erro SetSocket",14,5,135);
}


A.family = netSocketAddrINET;
A.port = NetHToNS(1024);//_pda_float_to_sdword(porta));
A.addr = NetLibAddrAToIN(libRefnum, "192.168.10.118");
//WinDrawChars(porta,sizeof(porta),5,140);
if(NetLibSocketBind(libRefnum,DataSock,(NetSocketAddrType*)&A,sizeof(A),timeout,&errP)< 0){
//WinDrawChars("Erro SockBind",13,5,135);
if(errP == netErrParamErr) WinDrawChars("SockBind - ParamErr",19,3,125);
}
errP = NULL;
if(NetLibSocketListen (libRefnum,DataSock, 1,timeout, &errP)<0){
//WinDrawChars("Erro SockListen",15,5,135);
if(errP == netErrParamErr) WinDrawChars("SockListen - ParamErr",21,3,125);
}


_________________________________________________________________
MSN Hotmail, o maior webmail do Brasil.  http://www.hotmail.com





--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to