473,396 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dns.Resolve on TCP Connection

Hi have developed a ftp append code in VB.net (.net1.1).
I am creating a TCP socket on port 21 using server hostname.The code work fine in my laptop but when i test in a device with WindowsXPe , i am getting a Dns.Resolve error as "The type initilizer for system.Net.Dns threm exception"
at Dns.Resolve(remoteHost)
Please help me !!!!

Expand|Select|Wrap|Line Numbers
  1. Public Sub New(ByVal remoteHost As String, ByVal controlPort As Integer, ByVal timeout As Integer)
  2.             Try
  3.                 Dim remoteHostEntry As IPHostEntry = Dns.Resolve(remoteHost)
  4.                 Dim ipAddresses() As IPAddress = remoteHostEntry.AddressList
  5.                Initialize(ipAddresses(0), controlPort, timeout)
  6.             Catch ex As Exception
  7.                 Logger.Write(ELogLevel.ERROR, ex.Message)
  8.             End Try
  9. End Sub
  10.  
  11. Friend Sub Initialize(ByVal remoteAddr As System.Net.IPAddress, ByVal controlPort As Integer, ByVal timeout As Integer)
  12.  
  13.             Try
  14.                 'establish socket connection & set timeouts
  15.                 Dim ipe As IPEndPoint = New IPEndPoint(remoteAddr, controlPort)
  16.  
  17.                 controlSock = New Socket(AddressFamily.InterNetwork,    SocketType.Stream, ProtocolType.Tcp)
  18.                 TimeOutValue = timeout
  19.                 controlSock.Connect(ipe)
  20.                 InitStreams()
  21.                 ValidateConnection()
  22.             Catch ex As Exception
  23.                 Logger.Write(ELogLevel.ERROR, " ex.Message)
  24.             End Try
  25.  
  26. End Sub
  27.  
  28.  
  29.         End Sub
  30.  
Oct 15 '09 #1
4 2924
Plater
7,872 Expert 4TB
Sounds like whatever code you are writing, one of the functions is not available on compact framework.
Which line was it that had the exception? and what was the exact exception message?
Oct 15 '09 #2
i am using normal .net 1.1 framework , it was working fine earlier know its stopped. I am getting error in
Dim remoteHostEntry As IPHostEntry = Dns.Resolve(remoteHost) this line
Oct 15 '09 #3
Plater
7,872 Expert 4TB
@veerusrahul
Right but you said when you put on WindowsXPe (XP embedded), which would use the compact framework, it stops working.
Oct 19 '09 #4
Resolved , there was a problem with Log4net logging but it was always showing this error at that particular time.
Oct 19 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tim Veldhuizen | last post by:
Hi all! I'm attempting at writing a networked program. It is going to be a threaded irc server in c++ using almost nothing but oop code. And it needs to know the full hostname of the users that...
6
by: John | last post by:
Hi Right password -> ORA-12154: TNS:Could not resolve service name wrong password => ORA-01017: invalid username/password; logon denied Tested on a Windows XP client connecting to Oracle on...
0
by: User | last post by:
Hi, I am writing a program in VB.NET and it is very slow when it reach this line : .... Dim ipHostInfo As IPHostEntry = Dns.Resolve(strMyForeignIP) ....
1
by: User | last post by:
Hi, I am writing a program in VB.NET and it is very slow when it reach this line : Dim ipHostInfo As IPHostEntry = Dns.Resolve(strMyForeignIP) It stay there at least 5 seconds to reach the...
5
by: Bruno Otero | last post by:
Hi, My connection string in my web application to my oracle database is working fine when i test it on my machine.. But when i try to run the application on the web server the error ORA-12154:...
1
by: Peter Treier | last post by:
Hi all i got the folowing problem. I need to resolve the endpoint (target IP Adresss) of a IP Network connection. I got a established connection from 123.123.123.123:6000 What i need to...
5
by: jstmehr4u3 | last post by:
I just installed ODP.net 10.2.02 on my local machine (Windows XP Pro) running IIS. I have created a sample webservice in VS2003, connecting to localhost. I am getting:...
8
by: CJM | last post by:
I have a working web application (ASP) which links to an Oracle 10g DB via OO4O. I'm trying to port it to either of two test servers, but in fact, I can't get it to work with either - 'Unable to...
0
by: antonyliu2002 | last post by:
I searched this group with key word ORA-12145, and got 0 hits. I posted this question yesterday in the oracle group. I thought over this issue, and I think people here may have come across...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.