-
Hi All,
Anyone, please please help.......
The scenario :
1)The host/remote side have their own application to transmit and receive data.
2) I have a PC at my site, my PC have to send some message to host thru TCP/IP .
Question:
I understand that winsock have to have both server and client install in oder for them to connect. But i can't install any application at their side,
So, is that a way for me to connect in VB without install any application at their side? How to detect the data arrive? And how to sent out the data from my application?
What is the thing that i need to take into consideration in order for me to connect to host?
Thanks ..
-
To make a TCP conneciton there must be something listening on a tcp port on the remote side, and something willing to connect from the client.
So if you were to connect your mail client to the ftp port of a server, you would have a TCP connection.
So all you have to do is connect and send the required data ...
-
But my problem is i don't even know what to use in order to connect, may be winsock, mscomm.....
-
You would use a winsock control.
Personally I use the microsoft winsock control.
You can use it by going,
Project > Components > Microsoft Winsock Control
Then stick it on your form.
Give it a remotehost + remoteport property.
Then to make it connect, you just do :
All of the events for the winsock control are pretty straightforward.
And to grab data coming into the winsock control you'd do something like this :
Code:
Dim strString As String
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Winsock1.GetData strString, vbString
'strString now contains the data that came in
End Sub
That help clear things up ?