Hmm..I'm on planning stage of making tiny ftp-client.
But I only worked with one socket before in blocking or nonblocking mode.
So, I thought I'd create a main nonblocking socket for the window procedure,
which I connect and send commands to ftp-server on port 21.

Then when data is streamed to and from ftp-server it's on port 20 right,
so I thought how would I go about with that.

I thought of these possible ways:

1.Create another non-blocking socket on a dummy dlgBox procedure (dialogbox not shown on screen), to receive/send filedata ?

or

2.Create a blocking socket to send/listen for data in a thread?

or

3. some other way?

Hmm....
hints on a standard robust way of doing it would be much appreciated!
:)

merry christmas btw
Posted on 2002-12-25 04:11:28 by david
Did you know that you can also use WSAAsyncSelect multiple times on the same window? In your WM_SOCKET handler, you can use wParam (which contains the socket handle) to distinguish between sockets.

Option 2 is pretty good for multiple connections, but you probably don't need it for a small FTP client. It's more suited to a small FTP server.
Posted on 2002-12-25 04:31:32 by Qweerdy

Did you know that you can also use WSAAsyncSelect multiple times on the same window? In your WM_SOCKET handler, you can use wParam (which contains the socket handle) to distinguish between sockets.

Option 2 is pretty good for multiple connections, but you probably don't need it for a small FTP client. It's more suited to a small FTP server.


My god, I never knew about I could have more than one sockets for non-blocking
:stupid:

All this time I never knew of it - Hahaa!! That's great, thank you for informing me, I always thought I had to create another window(arggghh) ..

THanks a lot qweerdy,
Posted on 2002-12-25 08:58:40 by david
or, you could use threads... hehheh... i'm going to point you to my single source code contribution here :grin: it's a web server and not an FTP client, though. Haven't touched sockets, since, in ASM.

http://www.asmcommunity.net/board/index.php?topic=6053
Posted on 2002-12-25 11:06:50 by jademtech