|
-
May 13th, 2003, 05:21 AM
#1
Thread Starter
Junior Member
Winsock
I have a problem and hope someone can help.
when I run this code I cant connect to a server, I just get a error
message returned:
The attempt to connect timed out
or
Authoritive answer: Host not found
I've tried several irc servers but always get an error.
Can someone tell me what is wrong with this code?
I'm new to winsock and have been getting code from various
places but nothing seems to work and I cant find any decent help
with my problem.
Code:
Private Sub Command1_Click()
Winsock1(0).SendData Text1.Text & vbCrLf
End Sub
Private Sub Command2_Click()
Dim RemHost As String
Dim RemPort As Integer
Dim HostName As String
RemHost = Text2.Text
RemPort = Text3.Text
HostName = Text4.Text
List3.AddItem "***Connecting..."
Winsock1(0).Connect RemHost, RemPort
End Sub
Private Sub Command3_Click()
Winsock1(0).Close
List3.AddItem "***Disconnected."
End Sub
Private Sub Winsock1_Connect(Index As Integer)
List3.AddItem "***Connected!", vbInformation
' Introduce ourselves to the IRC server. Our nickname will be "WVB_Test"
With Winsock1(0)
.SendData "NICK WVB_Test" & vbCrLf
.SendData "USER WVB_Test " & Winsock1(0).LocalHostName & " " & _
UCase(Winsock1(0).LocalHostName & ":" & Winsock1(0).LocalPort & "/0") & _
" :WinsockVB Test Client" & vbCrLf
End With
End Sub
Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim strBuff As String
Winsock1(0).GetData strBuff, vbString
List3.AddItem vbCrLf & strBuff, vbInformation
End Sub
Private Sub Winsock1_Error(Index As Integer, 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)
List3.AddItem "***Error occured : (" & Scode & ":" & Description & ")"
Winsock1(0).Close
List3.AddItem "***Connection Closed."
End Sub
Any ideas/help would be great, thanks.
--------------------
Almost as much goodness as a tramps pants.
-
May 13th, 2003, 06:10 AM
#2
Retired VBF Adm1nistrator
In Command2_Click() can you MsgBox RemHost and RemPort.
The IRC Servers you're trying to connect to may no longer exist.
The error : "Authoritive answer: Host not found" is a DNS error.
Basically an authoritive DNS server is telling you that it could not find that hostname in its list of DNS entries.
Try ircnet.demon.co.uk or efnet.demon.co.uk
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
May 13th, 2003, 07:23 AM
#3
Thread Starter
Junior Member
Thanks for the reply!
i've tryed many servers including ircnet.demon.co.uk and efnet.demon.co.uk and i've tried connecting to thier ips but I'm still getting the same problems.
I'm using a college computer, could that be a reason? some kind of restrictions?
I'm also getting the error:
The attept to connect timed out.
what to you mean:
In Command2_Click() can you MsgBox RemHost and RemPort
msgbox remhost & remport ?
--------------------
Almost as much goodness as a tramps pants.
-
May 13th, 2003, 07:28 AM
#4
Retired VBF Adm1nistrator
Just MsgBox the variables to make sure you're pulling the correct strings.
If its inside a college, then you may have a proxy server to get through.
That proxy probably handles DNS requests itself, and as such, any other DNS servers inside your LAN would probably only serve DNS and WINS requests locally only.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
May 13th, 2003, 07:32 AM
#5
Thread Starter
Junior Member
i'm getting the correct strings in the msgbox so thats ok.
As for the proxy, any ideas/sites/code on how to get past it?
Thanks.
--------------------
Almost as much goodness as a tramps pants.
-
May 13th, 2003, 07:35 AM
#6
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
May 13th, 2003, 07:38 AM
#7
Thread Starter
Junior Member
--------------------
Almost as much goodness as a tramps pants.
-
May 13th, 2003, 07:42 AM
#8
Retired VBF Adm1nistrator
Do :
Start > run > cmd
Then do : ipconfig
Do you have DNS server addresses listed ?
Then right click on internet explorer, go into properties, go into connections, check the proxy settings.
Is the browser getting the settings from a URL, or do you have proxy addresses in there ?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
May 13th, 2003, 07:49 AM
#9
Thread Starter
Junior Member
theres a few ip addresses:
Ip Address...
Subnet Mask...
Default Gateway...
There are no proxy addresses.
--------------------
Almost as much goodness as a tramps pants.
-
May 13th, 2003, 07:50 AM
#10
Retired VBF Adm1nistrator
Okay, try doing a traceroute.
Start > Run > cmd
tracert www.vbforums.com
Does the trace get outside your network ?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
May 13th, 2003, 07:57 AM
#11
Thread Starter
Junior Member
it went through a few different addresses/ips but I cant see vbforums on the list.
--------------------
Almost as much goodness as a tramps pants.
-
May 13th, 2003, 07:59 AM
#12
Retired VBF Adm1nistrator
Did it get outside of your network though ?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
May 13th, 2003, 08:00 AM
#13
Thread Starter
Junior Member
--------------------
Almost as much goodness as a tramps pants.
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
|