|
-
Nov 30th, 2008, 05:06 AM
#1
Thread Starter
New Member
wrong protocol or connect request, where's error ?
Hello everyone, at first im sorry about my bad English.
I am learning Vb6. I want co code a client software to communicate with IRC protocol. I can open a connect to IRC server on 6667 port. But when i try to send data to it to register my nick, user and join to channel so i get an error is :"Wrong protocol or connect state for the requested transaction or request" . I dont know where is error ? Please help me !Thanks in advance.
Here is my code :
vb Code:
Private Sub Command1_Click() Winsock2.Close Winsock2.RemoteHost = "irc.datviet.net" Winsock2.RemotePort = 6667 Winsock2.Connect If Winsock2.State <> sckConnected Then MsgBox "can not connect" Exit Sub Else MsgBox "connected" End If End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Dim data As String Winsock1.GetData data MsgBox data End Sub
-
Nov 30th, 2008, 08:49 AM
#2
Re: wrong protocol or connect request, where's error ?
Welcome to VBForums.
Exactly what are you sending?
-
Nov 30th, 2008, 09:58 AM
#3
Thread Starter
New Member
Re: wrong protocol or connect request, where's error ?
Well i want to send data,for exam:
Code:
winsock.sendData "Nick " & "netghost" & vbCrlf
winsock.sendData "USER " & "netghost" & " 0 0 " & "netghost" & vbCrlf
winsock.sendData "JOIN #CB" & vbCrlf
When i connect to IRC i have to register a nick for myself . But there is an error when i try to send data to it. I done it with another programming languages but with vb i cant do it. Please help me.
-
Nov 30th, 2008, 09:59 AM
#4
Re: wrong protocol or connect request, where's error ?
Do you have some reference documents on the IRC protocol?
-
Nov 30th, 2008, 10:05 AM
#5
Re: wrong protocol or connect request, where's error ?
Here's the RFC for IRC. It sounds like you're violating the protocol rules somewhere in the communication, you migt want to read the RFC if you havent already.
-
Nov 30th, 2008, 10:10 AM
#6
Thread Starter
New Member
Re: wrong protocol or connect request, where's error ?
Do you have some reference documents on the IRC protocol?
Yes i have. I done it with autoIT and its ok. I have the document about IRC protocol and i already read it. Hmm let me try to read it again. Thank you !
-
Dec 1st, 2008, 07:35 AM
#7
Re: wrong protocol or connect request, where's error ?
Your code looks a little 'odd'.
In your first Post you are connecting with Winsock2 and expecting data to arrive on Winsock1, then in your second Post you are trying to send data on Winsock - that's 3 Winsocks and only one might be connected. You should be using just one Winsock control.
-
Dec 1st, 2008, 07:52 AM
#8
Thread Starter
New Member
Re: wrong protocol or connect request, where's error ?
Hmm i fixed it but it doesnt work. I dont know where is my error ?
-
Dec 1st, 2008, 07:55 AM
#9
Re: wrong protocol or connect request, where's error ?
Perhaps you should post all your code than we might see what's going wrong
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
|