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