S
Sean Patterson
...at least in my code anyway!
I'm almost at my wits end here. 8^D I've written a simple logging style
tool that when the user docks the item in the cradle and hits the
synchronzie button, it FTPs the file to a remote server.
I have the scan gun cradled and can get out on the internet using
Internet Explorer. I also installed neoFTP and can connect to the FTP
server through that when I run it (note that it is a completely separate
computer than the one the cradle is attached to). I have my IPSec
diabled to make sure nothing is blocking traffic. I've even downloaded
and integrated the basic Rebex FTP class to do the file transfer and
things work fine.
However, when my code tries to connect to the same IP address, I get
problems. I've borrowed some open source code and this is the connect
method used. Note, my method that makes the connection is specifying an
IP address, not an domain name that needs resolving, so hopefully that
eliminates a step
Public Function Login() As Boolean
Dim ep As IPEndPoint
Dim ServerIP As IPAddress
m_objClientSocket = New Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp)
ep = New IPEndPoint(Dns.Resolve(m_sRemoteHost).AddressList(0),
m_iRemotePort)
Try
m_objClientSocket.Connect(ep)
Catch ex As Exception
MessageString = m_sReply
Throw New IOException("Couldn't connect to remote server")
End Try
ReadReply()
If (m_iRetValue <> 220) Then
CloseConnection()
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
SendCommand("USER " & m_sRemoteUser)
If (Not (m_iRetValue = 331 Or m_iRetValue = 230)) Then
Cleanup()
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
If (m_iRetValue <> 230) Then
SendCommand("PASS " & m_sRemotePassword)
If (Not (m_iRetValue = 230 Or m_iRetValue = 202)) Then
Cleanup()
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
End If
m_bLoggedIn = True
ChangeDirectory(m_sRemotePath)
' Return the end result.
Return m_bLoggedIn
End Function
When it tries to connect, I get the error "This is usually a temporary
error during hostname resolution and means that the local server did not
receive a response for an authoritative server."
I've been virtually everywhere on the net and am having no luck. Please
help!
If you want to swing things the other angle, I downloaded and started a
small FTP class based on the wininet.dll library and the connection
within that just hangs.
What am I missing guys?!
Thanks in advance for any insight you may have!
- Sean
I'm almost at my wits end here. 8^D I've written a simple logging style
tool that when the user docks the item in the cradle and hits the
synchronzie button, it FTPs the file to a remote server.
I have the scan gun cradled and can get out on the internet using
Internet Explorer. I also installed neoFTP and can connect to the FTP
server through that when I run it (note that it is a completely separate
computer than the one the cradle is attached to). I have my IPSec
diabled to make sure nothing is blocking traffic. I've even downloaded
and integrated the basic Rebex FTP class to do the file transfer and
things work fine.
However, when my code tries to connect to the same IP address, I get
problems. I've borrowed some open source code and this is the connect
method used. Note, my method that makes the connection is specifying an
IP address, not an domain name that needs resolving, so hopefully that
eliminates a step
Public Function Login() As Boolean
Dim ep As IPEndPoint
Dim ServerIP As IPAddress
m_objClientSocket = New Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp)
ep = New IPEndPoint(Dns.Resolve(m_sRemoteHost).AddressList(0),
m_iRemotePort)
Try
m_objClientSocket.Connect(ep)
Catch ex As Exception
MessageString = m_sReply
Throw New IOException("Couldn't connect to remote server")
End Try
ReadReply()
If (m_iRetValue <> 220) Then
CloseConnection()
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
SendCommand("USER " & m_sRemoteUser)
If (Not (m_iRetValue = 331 Or m_iRetValue = 230)) Then
Cleanup()
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
If (m_iRetValue <> 230) Then
SendCommand("PASS " & m_sRemotePassword)
If (Not (m_iRetValue = 230 Or m_iRetValue = 202)) Then
Cleanup()
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
End If
m_bLoggedIn = True
ChangeDirectory(m_sRemotePath)
' Return the end result.
Return m_bLoggedIn
End Function
When it tries to connect, I get the error "This is usually a temporary
error during hostname resolution and means that the local server did not
receive a response for an authoritative server."
I've been virtually everywhere on the net and am having no luck. Please
help!
If you want to swing things the other angle, I downloaded and started a
small FTP class based on the wininet.dll library and the connection
within that just hangs.
What am I missing guys?!
Thanks in advance for any insight you may have!
- Sean