|
-
Oct 18th, 2001, 04:55 AM
#1
Thread Starter
Fanatic Member
winsock
Hi i'm trying to make a simple chat application for me and a mate in the office.
my pc name = "Orleans05"
my mates pc name "orleans11"
now i have been trying to use the winsock control useing the UDP method as described in MSDN. I can get it ro work on my machine ( but that is pointless fro a chat app) I wounder if any one can help.
Below is the code.
code on my machine:
Option Explicit
Private Sub Form_Load()
With udpPeerA
.RemoteHost = "Orleans11"
.RemotePort = 1001
.Bind 1002
End With
frmPeerB.Show
End Sub
Private Sub txtSend_Change()
udpPeerA.SendData txtSend.Text
End Sub
Private Sub udpPeerA_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
udpPeerA.GetData strData
txtOutput.Text = strData
End Sub
code I placed on my mates machine:
Option Explicit
Private Sub Form_Load()
With udpPeerB
.RemoteHost = "Orleans05"
.RemotePort = 1002
.Bind 1001
End With
End Sub
Private Sub txtSend_Change()
udpPeerB.SendData txtSend.Text
End Sub
Private Sub udpPeerB_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
udpPeerB.GetData strData
txtOutput.Text = strData
End Sub
hope some one can help.
p.s for once one of Karl moores tut's was little help( sorry Karl , I do love your tuts)
Useful Links
.Net
#Develop, GhostDoc, CodeKeep , be.PINVOKE, Good Code Snippet Site
Krypton Toolkit, XPCC / XP Common Controls, QSS Windows Forms Components
VB.COM
VB.Classic Help File, MB Controls, MZTools, ADO Stored Procedure Generator add-in,
-
Oct 18th, 2001, 06:19 AM
#2
PowerPoster
What errors are you getting?
And are these pc names the same as what is recognised by the network?
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 18th, 2001, 06:36 AM
#3
Thread Starter
Fanatic Member
Hi rjlohan , Thanks
Yes they are the Names used:
the error is Runn Time '40006'
Useful Links
.Net
#Develop, GhostDoc, CodeKeep , be.PINVOKE, Good Code Snippet Site
Krypton Toolkit, XPCC / XP Common Controls, QSS Windows Forms Components
VB.COM
VB.Classic Help File, MB Controls, MZTools, ADO Stored Procedure Generator add-in,
-
Oct 18th, 2001, 03:00 PM
#4
New Member
and what error description?
martijn
-
Oct 18th, 2001, 05:27 PM
#5
PowerPoster
Yeah, give me the description if you can, I hate Error Lookup.
The code you have should work. Check the computer names you are using, and perhaps try using their IP to test if that is where the problem lies.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 19th, 2001, 10:26 AM
#6
Frenzied Member
40006 is an invalid state or protocol error.
Since your code does not indicate that you are setting the protocols to one or the other, check properties for the winsock controls and change the protocols to UDT if they are set to TCP.
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
|