General information
Category:
ActiveX controls in VFP
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?
>>I am trying to send data to a TCP port. What port should I use for my testing?
>>
>>Thanks
>
>Ports 0-1023 are often reserved by different programs; for temporary ports, numbers >= 1024 are used.
>
>This happens all the time; for instance, a Web server "listens" (1) on port 80. Now the client - say, Opera (a browser) - will send segments (2) with a destination port of 80, and an origin port of 1024 (or some other number). Let's assume it is port 1024. For the next file that is requested - another window, or another file for the same browser window (e.g. another image), the client will assign port 1025.
>
>The client can not use port 80, because (a) it may itself function as a server, and (b) as outlined above, more than one simultaneous connection may be required.
>
>It is also possible for programs to "listen" on higher port numbers. This happens especially with trojan backdoors.
>
>The command netstat will show you which ports are currently used.
>
>
>(1) I guess this means that the Web server application registered itself with the operating system, or perhaps more specifically with a TCP process, thus informing it that any traffic to the specified port should be sent to the Web server, which will process it.
>
>(2) "Packet" is used for layer 3 (IP); at layer 4 (TCP or UDP) the equivalent word is "segment". It is a similar concept.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only