Hello, I am trying to use network transfer and windows functionality I am unfamiliar with to accomplish the following:
Abstract: I am trying to capture enough information from a client during an FTP file transfer from the client to my host server so that I can initiate an FTP file transfer back to the client at a later time. The client can operate in client/server mode if needed.
Sorry for the long winded explanation but I've found it more useful to be verbose on the front end for clarity's sake.
The hardware setup consists of my product that is installed in a customer's home and has a wireless network card in it (cool product called WiFly from roving networks http://www.rovingnetworks.com/documents/WiFlyGSX-um.pdf) and can successfully initiate a TCP/IP FTP session with my host computer (sitting in my office) at a fixed IP address to periodiocally (4x daily) push a file into my computer. This part of the process is working fine (file transfer from my product in customer's home to my computer in my office).
The path the file takes is from: My wireless product in a customer's home -> wireless access point (Cisco wireless router I control, CAT5 wired to the home owner's router, gets it's IP via DHCP from home owner's router) -> home owners router (I may not have much control over this router's settings) -> home owner's cable modem -> internet -> my cable modem (with fixed IP address) -> my router ->my host computer running an FTP server (based on MarshallSoft's FTP Client Engine Library for PB).
The first file transfer is initiated by my product to my computer after it is installed at the customer's home and that works fine. The product initiates the FTP session, my computer has an FTP server listening and waiting, the file is received and the session is closed. During that first transfer from the my product in the customer's home to my computer, I would like to be able to capture the necessary information needed to do a file transfer in reverse: initiating an FTP file transfer from my computer back to my product at a later time (event based).
To summarize what I would like to do and the subsequent file transfer path:
Capture necessary info during incoming FTP file transfers from my product (IP address from customer's home?) -> Initiate an FTP transfer from my computer to my product -> send file to my router -> my cable modem -> internet ->home owner's cable modem -> home owner's router -> my Cisco wireless router -> my product
I can do an FTP Get command from my product to my computer but I also need to have the ability to initiate a transfer from my computer to my product based on specific events. I do realize that if the home owner's cable modem's IP address changes prior to my product's next file upload into my computer, I would not be able to communicate to that particular unit until I received it's next file transfer where I could then capture the new IP address and then push the file to the unit.
As I see it, I face a number of problems that I know about and undoubtedly a larger number of problems I am unaware of:
1) Is it possible to capture the home owner's cable modem IP address during the FTP session initiated from the product to my computer? if so, what PB code would help facilitate capturing that IP address and where within my FTP server code would I insert it? Part of the reason I want the home owner's IP address is that I realize it will change over time so I need to capture it and compare it to that product's previously sent IP and update if it has changed. I've seen some very daunting WinSock code in some of the source code examples and it's far beyond the type of programming I am familiar with Relevant post on ws2_32.dll
2) What information is needed for my computer to initiate an FTP file transfer back to my product? Even if I have the IP address of the home owner's cable modem, is that enough to be able to initiate an FTP file transfer to my product from my computer given all the routers I have to go through? Is there additional information I need like the MAC address from my product's wi-fi card or the IP address of the wireless router in the customer's home as assigned by the home owner's router? What PB code would help to collect all the necessary information so I could FTP back to my product?
3) How reliable would this process be if it could be accomplished (excluding what I already know about the problem of the home owner's cable modem IP potentially changing over time). Will software fire walls in the home owner's computer prevent the transfer back to the product? What would I have to tell the home owner to do or not do to his router to make this happen (hopefully not much)? If the IP address of my router changes (as issued by the home owner's router running DHCP) will that cause problems? etc.
4) What would I have to require from the home owner to do to his router to allow the file to be uploaded to my product (ex. packet forwarding)? My goal is for the home owner to not have to do anything to their router outside the normal default settings of the router since I can't rely on the settings remaining the same in case they change out their router or reset it.
5) Less important at this time but will be important in the future: what steps should I take to make the FTP transfer from my computer to the product more secure (I'm less concerned with the transfer from the product to my computer). I have less capabilities at my product's side of things since it's not a computer running an OS. Things like
If there is a PB library that would help facilitate this ie. allow me to write easier code at a higher level (rather than getting down to the WinSock level) I would be happy to purchase it (something similar to Marshallsoft's TCP/IP Library, although there's no PowerBuilder version). As far as I can tell there's nothing the the Marshallsoft's FTP Client software that I already own to accomplish any of this (I could be wrong).
I found functions like gethostbyaddr() in the WS2_32.inc in some of the sample code posted but I'm not sure if that's what I need or how to implement appropriately.
Easy to understand code samples would be much appreciated. If you have some insight on a particular question, please reference which number (1-5) you're answering for ease of discussion.
Thanks very much for your help! The PB forums is one of the main reasons I went with this product.
-Robbie Clark
Abstract: I am trying to capture enough information from a client during an FTP file transfer from the client to my host server so that I can initiate an FTP file transfer back to the client at a later time. The client can operate in client/server mode if needed.
Sorry for the long winded explanation but I've found it more useful to be verbose on the front end for clarity's sake.
The hardware setup consists of my product that is installed in a customer's home and has a wireless network card in it (cool product called WiFly from roving networks http://www.rovingnetworks.com/documents/WiFlyGSX-um.pdf) and can successfully initiate a TCP/IP FTP session with my host computer (sitting in my office) at a fixed IP address to periodiocally (4x daily) push a file into my computer. This part of the process is working fine (file transfer from my product in customer's home to my computer in my office).
The path the file takes is from: My wireless product in a customer's home -> wireless access point (Cisco wireless router I control, CAT5 wired to the home owner's router, gets it's IP via DHCP from home owner's router) -> home owners router (I may not have much control over this router's settings) -> home owner's cable modem -> internet -> my cable modem (with fixed IP address) -> my router ->my host computer running an FTP server (based on MarshallSoft's FTP Client Engine Library for PB).
The first file transfer is initiated by my product to my computer after it is installed at the customer's home and that works fine. The product initiates the FTP session, my computer has an FTP server listening and waiting, the file is received and the session is closed. During that first transfer from the my product in the customer's home to my computer, I would like to be able to capture the necessary information needed to do a file transfer in reverse: initiating an FTP file transfer from my computer back to my product at a later time (event based).
To summarize what I would like to do and the subsequent file transfer path:
Capture necessary info during incoming FTP file transfers from my product (IP address from customer's home?) -> Initiate an FTP transfer from my computer to my product -> send file to my router -> my cable modem -> internet ->home owner's cable modem -> home owner's router -> my Cisco wireless router -> my product
I can do an FTP Get command from my product to my computer but I also need to have the ability to initiate a transfer from my computer to my product based on specific events. I do realize that if the home owner's cable modem's IP address changes prior to my product's next file upload into my computer, I would not be able to communicate to that particular unit until I received it's next file transfer where I could then capture the new IP address and then push the file to the unit.
As I see it, I face a number of problems that I know about and undoubtedly a larger number of problems I am unaware of:
1) Is it possible to capture the home owner's cable modem IP address during the FTP session initiated from the product to my computer? if so, what PB code would help facilitate capturing that IP address and where within my FTP server code would I insert it? Part of the reason I want the home owner's IP address is that I realize it will change over time so I need to capture it and compare it to that product's previously sent IP and update if it has changed. I've seen some very daunting WinSock code in some of the source code examples and it's far beyond the type of programming I am familiar with Relevant post on ws2_32.dll
2) What information is needed for my computer to initiate an FTP file transfer back to my product? Even if I have the IP address of the home owner's cable modem, is that enough to be able to initiate an FTP file transfer to my product from my computer given all the routers I have to go through? Is there additional information I need like the MAC address from my product's wi-fi card or the IP address of the wireless router in the customer's home as assigned by the home owner's router? What PB code would help to collect all the necessary information so I could FTP back to my product?
3) How reliable would this process be if it could be accomplished (excluding what I already know about the problem of the home owner's cable modem IP potentially changing over time). Will software fire walls in the home owner's computer prevent the transfer back to the product? What would I have to tell the home owner to do or not do to his router to make this happen (hopefully not much)? If the IP address of my router changes (as issued by the home owner's router running DHCP) will that cause problems? etc.
4) What would I have to require from the home owner to do to his router to allow the file to be uploaded to my product (ex. packet forwarding)? My goal is for the home owner to not have to do anything to their router outside the normal default settings of the router since I can't rely on the settings remaining the same in case they change out their router or reset it.
5) Less important at this time but will be important in the future: what steps should I take to make the FTP transfer from my computer to the product more secure (I'm less concerned with the transfer from the product to my computer). I have less capabilities at my product's side of things since it's not a computer running an OS. Things like
If there is a PB library that would help facilitate this ie. allow me to write easier code at a higher level (rather than getting down to the WinSock level) I would be happy to purchase it (something similar to Marshallsoft's TCP/IP Library, although there's no PowerBuilder version). As far as I can tell there's nothing the the Marshallsoft's FTP Client software that I already own to accomplish any of this (I could be wrong).
I found functions like gethostbyaddr() in the WS2_32.inc in some of the sample code posted but I'm not sure if that's what I need or how to implement appropriately.
Easy to understand code samples would be much appreciated. If you have some insight on a particular question, please reference which number (1-5) you're answering for ease of discussion.
Thanks very much for your help! The PB forums is one of the main reasons I went with this product.
-Robbie Clark
Comment