Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fine Tuning the Winsock ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00792175
Message ID:
00800265
Views:
28
Basically what I need to do is implement a listener (server) and a caller (client). I've managed to dig up the client code, as shown below, but I'm having trouble finding the server code. Any ideas?

I'd like do this in VFP, if at all possible.
* Define constants
#DEFINE INTERNET_OPEN_TYPE_PRECONFIG 0
#DEFINE INTERNET_OPEN_TYPE_DIRECT 1
#DEFINE INTERNET_OPEN_TYPE_PROXY 3
#DEFINE SYNCHRONOUS  0
#DEFINE ASYNCHRONOUS 1
#DEFINE INTERNET_FLAG_RELOAD 2147483648

* Prepare for the Internet session
DECLARE INTEGER InternetOpen        IN wininet.dll ;
  STRING  cAgent,                                  ;
  INTEGER nAccessType,                             ;
  STRING  cProxyName,                              ;
  STRING  cProxyBypass,                            ;
  INTEGER nFlags

DECLARE INTEGER InternetOpenUrl     IN wininet.dll ;
 INTEGER hInternetSession,                         ;
 STRING  cURL,                                     ;
 STRING  cHeaders,                                 ;
 INTEGER nHeadersLength,                           ;
 INTEGER nFlags,                                   ;
 INTEGER nContext

DECLARE INTEGER InternetReadFile    IN wininet.dll ;
  INTEGER nfile,                                   ;
  STRING  @cBuffer,                                ;
  INTEGER nNumberOfBytesToRead,                    ;
  INTEGER @nBytesRead

DECLARE SHORT   InternetCloseHandle IN wininet.dll INTEGER hInst

* Open the Internet session
liInternetSession = InternetOpen("VFP 8.0", INTERNET_OPEN_TYPE_PRECONFIG, "", "", SYNCHRONOUS)

* Open the Internet URL
liURLFile = InternetOpenUrl(lnInternetSession, "http://jeffbowman.com/", '', 0, INTERNET_FLAG_RELOAD, 0)

IF liInternetSession = 0 OR liURLFile = 0
  WAIT WINDOW " The specified server cannot be contacted at this time. "
ELSE
  * Set aside a buffer
  lcResponse = SPACE(100000)

  * Go and get it!
  InternetReadFile(liURLFile, @lcResponse, 100000, 0)
ENDIF

* Close all the sessions we opened, in reverse order
InternetCloseHandle(liURLFile)
InternetCloseHandle(liInternetSession)
>I don't know how easy it would be to do in FoxPro but it would not be too hard to write something in C++ to handle the task.
>
>It depends on what exactly you do with the winsock control currently. You would only need to implement that functionality since that is all you use, but most applications that use Winsock use most of the functionality.
>
>My company is in the process of writing a control that lets developers use Winsock with a lot more power than the Winsock Control provides.
>
>If you, or anyone reading this is interested in working with the beta program you can email softeng@seekfordsolutions.com and put in the request.
>
>If you know C++ and about network communications you might be able to write one for your project.

Read about the greatest fraud in the history of mankind.
See TaxableIncome.net.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform