Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: m[a]rkus en Marzo 15, 2010, 04:00:28 pm
-
Hola tengo un problema algo raro, estoy haciendo un servidor de servicios irc y no se que pasa que el sock nunca me llega a conectar en cambio con otro proyecto que tengo si conecta a la misma ip y mismo puerto, aquí tengo el código de lo que eh echo por si ven algo mal:
OK Bind HOST: 192.168.0.15 PORT: 9180
OK Connecting to: irc.qvanos.net
STATE: sckConnecting
Option Explicit
Private WithEvents WSX As CSocketMaster
Dim cServer, cPuerto, cCanal, cNombre, cPass, cDescripcion As String
Dim nNick, nMode As String
Dim Buffer As String
Dim Buff() As String
'-------------------------------------------
'---------------CONFIGURACIÓN---------------
'- StarBlue v1.0 Por m[a]rkus -
'-------------------------------------------
Public Sub CrearVar()
cServer = txtServ.Text
cPuerto = txtPort.Text
cCanal = txtChan.Text
cNombre = txtNombre.Text
cPass = txtPass.Text
nNick = txtNick.Text
Reconectar.Interval = 5000 '5000 = 5 Segundos
cDescripcion = ":3,1.10:9:: 11StarBlue v1.0 por 4markus11 http://www.qvanos.net9::10:3."
End Sub
'-------------------------------------------
'----------FIN DE CONFIGURACIÓN-------------
'- StarBlue Por m[a]rkus -
'-------------------------------------------
'Boton conectar
Private Sub cmdConnect_Click()
WSX.CloseSck
WSX.Connect cServer, cPuerto
End Sub
'Cuando conecte el sock
Private Sub WSX_Connect()
WSX.SendData "PASS " & cPass & vbCrLf
WSX.SendData "PROTOCTL " & "UDB3.6,=, " & cServer & "TKLEXT" & vbCrLf
WSX.SendData "SERVER " & cServer & " 1 " & cDescripcion & vbCrLf
WSX.SendData "NICK " & nNick & " 1 " & "1268678199 " & "- " & "- " & cServer & " 0 " & ":Bot Central" & vbCrLf
WSX.SendData ": " & nNick & " JOIN " & cCanal & vbCrLf
End Sub
'Error en la conexion
Private Sub WSX_Error(ByVal Number As Integer, Description As String, ByVal sCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
WSX.CloseSck
txtDebug = txtDebug & "ERROR >>> " & Number & " " & Description
txtDebug = Len(txtDebug)
End Sub
'Cierra Sock
Private Sub WSX_CloseSck()
txtDebug = txtDebug & "DESCONECTADO >>> "
txtDebug = Len(txtDebug)
End Sub
'Lo que lee el sock
Private Sub WSX_DataArrival(ByVal bytesTotal As Long)
WSX.GetData Buffer
Buff = Split(Buffer, " ")
txtDebug.SelStart = Len(txtServ.Text)
txtDebug.Text = txtDebug.Text & "Servidor >" & Buffer
txtDebug.SelStart = Len(txtDebug.Text)
'---------Evento PinG PONG---------
If Buff(0) = "PING" Then
WSX.SendData "PONG :" & Buff(UBound(Buff())) & vbCrLf
End If
End Sub
'Cuando cargue el Form
Private Sub Form_Load()
Set WSX = New CSocketMaster
Call CrearVar
End Sub
Solucción: Cerre y Abri VB
Resolving host irc.qvanos.net with handle 7
STATE: sckHostResolved
OK Bind HOST: 192.168.0.15 PORT: 9192
OK Connecting to: irc.qvanos.net
STATE: sckConnecting
FD_CONNECT 1576
STATE: sckConnected
FD_WRITE 1576
FD_READ 1576
OK Bytes obtained from buffer: 150
OK Destroyed socket 1576
OK Destroyed winsock message window 3804664
OK Destroyed socket collection
OK Winsock service finalized
OK Freed subclass memory at: 2185984