|
-
Oct 27th, 2000, 02:17 PM
#1
Hi there.
I want to connect two or more computer using server/cliente method i want to use also winsock but i don´t have any code do do that, where can i get the code for the server and the client, thank you.
numibesi
-
Oct 27th, 2000, 02:22 PM
#2
Fanatic Member
-
Oct 27th, 2000, 02:55 PM
#3
Something else, please
Tx for the link but i tried and i keep getting lots of errors, so i tried to download the demo but some files are missing so i stuck again. Any idea.
numibesi
-
Oct 27th, 2000, 03:36 PM
#4
Frenzied Member
If you will tell us what errors you are getting, that would help us to figure out what is wrong.
-
Oct 27th, 2000, 04:15 PM
#5
See the text
Server
Code:
Private Sub Form_Load()
Winsock1.Protocol = sckTCPProtocol
Winsock1.LocalPort = 1212
Winsock1.Listen
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Dim strData As String
Winsock1.SendData "Hello From Server" 'the prob is here
Text1.Text = Text1.Text & strData
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Winsock1.GetData strData, vbString
Text1.Text = Text1.Text & strDataIP
End Sub
Client
Code:
Private Sub Command1_Click()
Winsock1.SendData "Client here!"
End Sub
Private Sub Form_Load()
IP = "127.0.0.1"
Port = "1212"
Winsock1.Protocol = sckTCPProtocol
Winsock1.Connect IP, Port
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Text1 = Text1 & bytesTotal
End Sub
The prob is on the server when i try to connect it says wrong prtocol etc.
-
Oct 27th, 2000, 04:24 PM
#6
Fanatic Member
Code:
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Dim strData As String
Winsock1.SendData "Hello From Server" 'the prob is here
Text1.Text = Text1.Text & strData
End Sub
Change it to:
Code:
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Dim strData As String
Winsock1.Close
Winsock1.Accept requestID
Winsock1.SendData "Hello From Server"
Text1.Text = Text1.Text & strData
End Sub
-
Oct 27th, 2000, 04:45 PM
#7
one part done
That part now works but when i try to do this:
Code:
Private Sub Command1_Click()
Winsock1.SendData "Still connected"
End Sub
it gives me the same error wrong protocol......
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
|