473,805 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dns.Resolve on TCP Connection

9 New Member
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(rem oteHost)
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 2939
Plater
7,872 Recognized Expert Expert
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
veerusrahul
9 New Member
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(rem oteHost) this line
Oct 15 '09 #3
Plater
7,872 Recognized Expert Expert
@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
veerusrahul
9 New Member
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
9831
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 connect to it. I already get some info from this code: workersock = accept(mastersock, &sockaddr, &addrlen); printf("Received a Client Connection from: %s port: %d fd: %d\n", inet_ntoa(sockaddr.sin_addr), ntohs(sockaddr.sin_port), workersock);
6
15633
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 an AIX server. Using toad and sqlplusw Everything working fin connecting to other 8.1.7 Oracle servers on windows
0
935
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
402
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 foreign host, how can it be fast (instant)? With winsock (in VB6) it is instant connection.
5
8278
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: TNS:could not resolve service name appears. Here it is the connection string: string ConnectionString = @"Provider=msdaora;Data Source=GEST;User ID=IND;Password=****";
1
1985
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 know is the target IP Address and Port
5
17105
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: Oracle.DataAccess.Client.OracleException ORA-12154: TNS:could not resolve the connect identifier specified at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src,...
8
25621
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 make connection, ORA-12154: TNS:could not resolve the connect identifier specified'. This error occurs in the applications global.asa file where I'm trying to set up a connection pool: <object runat="Server" scope="Application" id="oSession"...
0
5688
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 similar problems. I am working on a ASP.NET 2.0 web application for IIS 6.0, the backend database for my web application is Oracle 10.1.0.2.0. This database resides on Machine A.
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10614
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10109
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.