|
-
Nov 30th, 2006, 05:21 PM
#1
Thread Starter
New Member
need help with TCP client
I am trying to write a cimple TCP client in VB6. I can connect to the server and read the first line (the greeting). After that, I try to send my computer information to the server ("user@host" for now). I dont know if i need to send a return character for my GetData to read the next line or not. Here is my code:
Dim server_greeting As String
Dim ACK As String
Private Sub Form_Load()
'Closes any possible open connection
Sock.Close
'Connects with the server
Sock.Connect
'Message box telling you are connected
MsgBox "Connected"
'Reads the greeting
Sock.GetData server_greeting
'Message box displays the greeting
MsgBox server_greeting
'Sends user@host
Sock.SendData "user@host"
'Reads the ACK
Sock.GetData ACK
'Displays ACK message
MsgBox ACK
'Closes connection
Sock.Close
End Sub
I have the server and port information already entered in the winsock's properties so I dont need to put it into code. Any help will be greatly appreciated. The server is ryker.aet.cup.edu, the port is 44001.
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
|