Results 1 to 9 of 9

Thread: wrong protocol or connect request, where's error ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    4

    Question 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:
    1. Private Sub Command1_Click()
    2.     Winsock2.Close
    3.     Winsock2.RemoteHost = "irc.datviet.net"
    4.     Winsock2.RemotePort = 6667
    5.     Winsock2.Connect
    6.     If Winsock2.State <> sckConnected Then
    7.         MsgBox "can not connect"
    8.          Exit Sub
    9.     Else
    10.         MsgBox "connected"
    11.     End If
    12. End Sub
    13. Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    14.     Dim data As String
    15.     Winsock1.GetData data
    16.     MsgBox data
    17. End Sub

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: wrong protocol or connect request, where's error ?

    Welcome to VBForums.
    Exactly what are you sending?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    4

    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.

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: wrong protocol or connect request, where's error ?

    Do you have some reference documents on the IRC protocol?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  5. #5
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    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.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    4

    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 !

  7. #7
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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.

  8. #8

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    4

    Re: wrong protocol or connect request, where's error ?

    Hmm i fixed it but it doesnt work. I dont know where is my error ?

  9. #9
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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
  •  



Click Here to Expand Forum to Full Width