Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send data to TCP port
Message
From
02/06/2008 14:28:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
02/06/2008 14:21:21
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01321081
Message ID:
01321099
Views:
17
>Here is my code:
>WITH ThisForm.Winsock1.Object
> .Protocol = 0
> .remotehost = 'localhost'
> .remoteport = 1024
> .connect() && error here
> .SendData('123')
>ENDWITH
>
>I am getting an error from Winsock "Connection forcefully rejected .."
>Any idea?

Well, I never worked with that Winsock object. And I don't know whether all the parameters are correct. For instance, .RemoteHost... is "localhost" a valid option? If it requires an IP address, you might try 127.0.0.1 - the "local loopback address", in other words, "my own computer".

But mainly, I would suspect that you can't just send information to a port, like 1024, unless you first set up an application to "listen" at that port. Perhaps what the error message is telling you is: "There is no application set up to process information at the specified port."

Perhaps it would help to RTFM, in this case, you might find some documentation about the Winsock object - which might give you are more "human-readable" version of the error messages.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform