CAsyncSocket vs. CSocket

Moderator: Project members

Post Reply
Message
Author
Kuruto
500 Command not understood
Posts: 1
Joined: 2004-07-21 07:27
Location: Wevelgem - Belgium

CAsyncSocket vs. CSocket

#1 Post by Kuruto » 2004-07-21 07:40

I noticed that CAsyncSocket is used instead of CSocket as a base class.
Is there a specific reason for doing this?
Would it also work if CSocket was used as a base class?

User avatar
botg
Site Admin
Posts: 35566
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

#2 Post by botg » 2004-07-21 10:52

In contrast to CAsyncSocket, CSocket works in synchronous mode. This means on any call to one of the CSocket methods, CSocket blocks the calling thread until all requested data has been read/sent.
However, since FileZilla should stay responsive during transfers, async sockets are used.

Also, using CSocket for FZ would not work because CSocket does not support socket events.

Post Reply