COM Error when trying to reply to announce message (General questions)
Hello,
I am getting a com error when I try to offer DHCP IP Addresses to clients. I imported your DHCP library through the C#.NET interop services. I get the following in my console output (After I caught the error and printed it)
First, my logging to see what I offered:
New Offer: address 192.168.0.230 on dhcp.kelleylog.com for 2147483647 (seconds)
Then the error once I offered it!
System.Runtime.InteropServices.COMException (0x800A7531): Couldn't send DHCP offer.
at wodDHCPDComLib.DHCPSessionClass.SendOffer()
at KLSSDHCPServer.KLSSDHCPServer.KLSSDHCPServer_Announce(DHCPSession Session) in C:KLSSSourceKLSSDHCPServerKLSSDHCPServerKLSSDHCPServer.cs:line 308
The code looks like this:
void KLSSDHCPServer_Announce(wodDHCPDComLib.DHCPSession Session)
{
m_textboxMessages.Text += Client + Session.HardwareAddress + is requesting a DHCP configuration offer.
;
Lease lease = null;
if (!m_dictionaryMACtoLease.TryGetValue(Session.HardwareAddress, out lease))
{
lease = new Lease(this, m_listAddresses[0], m_strDomain, m_iLeaseTime);
m_listAddresses.RemoveAt(0);
m_dictionaryMACtoLease.Add(Session.HardwareAddress, lease);
m_textboxMessages.Text += New Offer: address + lease.prop_strIPAddress + on + lease.prop_strDomain + for + lease.prop_iRemainingLeaseTime + (seconds)
;
System.Console.WriteLine( New Offer: address + lease.prop_strIPAddress + on + lease.prop_strDomain + for + lease.prop_iRemainingLeaseTime + (seconds) );
}
else
{
m_textboxMessages.Text += Re-Offering: address + lease.prop_strIPAddress + on + lease.prop_strDomain + for + lease.prop_iRemainingLeaseTime + (seconds)
;
System.Console.WriteLine( Re-Offering: address + lease.prop_strIPAddress + on + lease.prop_strDomain + for + lease.prop_iRemainingLeaseTime + (seconds) );
}
Session.IPAddress = lease.prop_strIPAddress;
Session.LeaseTime = lease.prop_iRemainingLeaseTime;
try
{
Line 308>> Session.SendOffer();
}
catch (System.Runtime.InteropServices.COMException comexception)
{
System.Console.WriteLine(comexception.ToString());
}
lease.LeaseOfferExpired += new Lease.LeaseOfferExpiredDelegate(lease_LeaseOfferExpired);
}
Any Ideas what is going on? This makes the library a little less than useful... Could this be because I am testing it on my own machine? (I.E. I am essentially using a loopback adapter to test, so my computer has no IP address yet, it is trying to acquire one from the DHCP server that I am writing that is running on the same computer)
Thanks!
Chris
Complete thread:
- COM Error when trying to reply to announce message - chrismooney, 2006-10-24, 16:20
- Re: COM Error when trying to reply to announce mes - chrismooney, 2006-10-25, 19:03
- Re: COM Error when trying to reply to announce mes - wodSupport, 2006-11-01, 19:59
- Re: COM Error when trying to reply to announce mes - chrismooney, 2006-10-25, 19:03