|
-
Feb 9th, 2000, 07:32 AM
#1
Here is the code...it is supposed to connect to the server and display "Hello World" when it connects to the server, All it does is keep the Command1 button disabled. Please help!!!
Option Explicit
Private Sub Command1_Click()
Winsock1.SendData "Hello World"
End Sub
Private Sub Form_Load()
Command1.Enabled = False
Winsock1.Connect InputBox$("Enter Server name:"), 7
End Sub
Private Sub form_unload(Cancel As Integer)
Winsock1.Close
End Sub
Private Sub winsock1_connect()
Command1.Enabled = True
End Sub
Private Sub winsock1_dataarrival(ByVal bytestotal As Long)
Dim temp As String
temp = String(bytestotal, Chr$(0))
Winsock1.GetData temp, vbString, bytestotal
MsgBox "hello"
End Sub
-
Feb 9th, 2000, 08:40 AM
#2
What are you trying to Connect to?
It's likely that the Server isn't Listening on Port 7
Also, When Sending Data be sure to terminate the Data with a vbCrLf or it won't actually get processed, ie.
Winsock1.SendData "Hello" & vbCrLf
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Certified AllExperts Expert
-
Feb 10th, 2000, 05:34 AM
#3
I'm trying to connect to the server using TCP/IP but it isn't connecting. How could I set the code up to send data to a port on the server that was listening, or how could I set up the server to listen for the data?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|