Re: ActiveX and Socket Programming



Dan - your question is good and I'll do the best to answer it and if you
have ideas I would love to hear them.

First, you said that sockets were not meant for large file transfers. What
about programs like pc Anywhere, don't they use sockets for their file
transfers? I know that they only require two ports. So, the first question
is whether I can even do a file transfer at all with sockets?

Second - here's my thought on why FTP might not work (or probably won't). I
have a VFP application that runs on a LAN for my clients. Now, I want to
allow them the ability to copy the app to their laptop. Next, they can take
their laptops "on the road" with them anywhere and work "offline" such as if
they are on an airplane or places where there is no internet access or the
access is weak. Also, when viewing large pdf files and with a lot of
windows open in my database application, it's going to take too long to
transfer the data and remote access will be slower than "offline" access.

The idea I have is this, allow them to make changes "offline" and then sync
the data back to the their network. Currently I have this all working but
they must go back to their office and hook their laptop to their LAN to do
the sync. I want to allow them the ability to sync the changes via the
internet without having to hook their laptops to the LAN. Here's my
algorithm and the problems I see with FTP:

1. The user clicks the Sync button on their laptop computer. The sockets
connect to the appropriate IP address and port(s). User is asked for a
username and password.

2. The Laptop computer creates a zip file (call it FILE1.ZIP for example)
with the changes for the various tables, text files and other files that
were changed. Then I have to upload this ZIP file to the LAN.

3. File Transfer the zip file from the Laptop to the LAN. The LAN must
then process this file and look for conflicts and then send a file back to
the laptop with the potential conflicts (call it File2.ZIP). For example,
it might say that a record was changed both on the LAN and on the laptop
computer since the last sync. Which record would you like to keep or would
you like to modify it and then save the changes? Once that is completed
another file is sent back to the LAN to resolve any conflicts (call it
File3.zip). Next, after the LAN processes that file, it then needs to send
File4.zip back to the laptop computer which would be all the changes on the
LAN since the last sync so that the laptop has the latest changes that were
made in the LAN environment.

So, there are files be transferred back and forth and processing must be
done in between the file transfers before the next file is transferred. I
think BIGGEST problem I have with FTP is that I want to transfer the files
directly to the LAN and I think I would need to have all my clients set up
an FTP server to listen for connections. I know how to FTP files as a
client but that would be to a website. You can't just ftp files to a LAN
(as far as I know). There has to be another program listening for
connections. The other problem, is I think it would require more ports to be
open and if they decide to run the program on several computers then each
computer on their LAN will need to allow for listening on different ports to
avoid conflicts with FTP.

I'm not saying it would not work, I'm just not sure what software would be
required. If I could drop an FTP ActiveX control on a form that would act
as a "server side" to listen for FTP connections and I could set up the
ports then that would be fantastic and probably solve all my problems. But,
I don't know if such a control exists. I already have an FTP activeX
control to connect as a client but how can I easily do this on the server
side to accept connections? Otherwise, I'm still stuck trying to find a
simple way to transfer files from a laptop computer to the LAN. Basically,
I'm going to need a program that runs on their LAN as the "server" and I
have a program that runs on the laptop as the "client" so it appears to be a
true client/server app I'm trying to write in FoxPro and this can be done
with sockets but it's dealing with the file transfer that has me all messed
up.

Thanks again for any input you can provide,

Mike





"Dan Freeman" <spam@xxxxxxxxxxxxx> wrote in message
news:OxUywWG$HHA.484@xxxxxxxxxxxxxxxxxxxxxxx
I'm wondering why you're using sockets at all.

For transferring files, use File Transfer Protocol (FTP even says it in
its name). It's free and built into the Windows API.

If you have peculiar requirements, fine, but know that you're going about
this in a peculiar way. Sockets were not meant for large file transfers
and that's why you're having so much trouble finding information on doing
it.

Dan

MikeA wrote:
I don't care about that. I'll pay for that. I actually already
bought an ActiveX control but that still does not answer how to set
up the protocols for socket programming and file transfers. I
already know how to pass data back and forth through the socket. It's the
algorithms for file transfer via a socket that have me all
mixed up.
Mike
"Man-wai Chang ToDie" <toylet.toylet@xxxxxxxxx> wrote in message
news:ejZpIH4%23HHA.4732@xxxxxxxxxxxxxxxxxxxxxxx
MikeA wrote:
Okay - now I'm wondering if maybe an FTP activeX control as a server
would
help because I already have an FTP ActiveX for a client. Anyone
have any ideas on the best way to do file transfers with a socket?

Most specialized ActiveX controls require money. You should be found
samples using winsock in http://fox.wikis.com.

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.04) Linux 2.6.22.6
^ ^ 20:28:01 up 9 days 10:47 1 user load average: 0.00 0.00 0.00
news://news.3home.net news://news.hkpcug.org
news://news.newsgroup.com.hk




.


Loading