467,077 Members | 1,046 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,077 developers. It's quick & easy.

sockets and dhcp?


Quick q:

If I open a socket on my computer and eventualy
the dhcp changes the address of my computer, what happens?
Will it drop the connection?

Thanks in advance for any help on the topic.
Dec 30 '07 #1
  • viewed: 2795
Share:
7 Replies
On Sun, 30 Dec 2007 00:50:01 -0800, TheMadHatter
<Th**********@discussions.microsoft.comwrote:
If I open a socket on my computer and eventualy
the dhcp changes the address of my computer, what happens?
Will it drop the connection?
Not really a C# or .NET question. You'll get much better advice from an
actual network programming newsgroup.

That said, AFAIK you can't change the DHCP-assigned IP address without
resetting all of the network connections. Typically, if the computer is
actually up and running when the DHCP lease runs out, the lease is just
renewed. So the sitaution you're asking about should never happen unless
you do it explicitly (e.g. "ipconfig /release" at the command prompt).

If you _do_ do it explicitly, then yes...I believe none of your
already-created sockets will work.

Pete
Dec 30 '07 #2
"TheMadHatter" <Th**********@discussions.microsoft.comwrote in message
news:0F**********************************@microsof t.com...
>
Quick q:

If I open a socket on my computer and eventualy
the dhcp changes the address of my computer, what happens?
Will it drop the connection?

Thanks in advance for any help on the topic.

First, this isn't technically a dotNET question, but since it can impact NET
applications, here's the scoop on DHCP. If you have a single active DHCP
server on your network, it will _ALWAYS_ re-lease the same IP to a DHCP
client unless that IP address has been either specifically reservered for
another client or removed from the scope of leasable IPs since he last
lease. This is part of the DHCP specification.

If you have multiple DHCP servers, it depends on whether or not the DHCP
server that previously supplied the lease handles the renewal request. If
it doesn't, then you may drop your connection.

Mike Ober.
Dec 30 '07 #3
>
If you _do_ do it explicitly, then yes...I believe none of your *
already-created sockets will work.
Yes I think that is correct, the nice thing is DHCP-leases as long as
connected they renew before they release (somhwere in my head a thing
like when 2/3 of lease time has expired)
so theoretically if you have a really poor connection and want this to
be a non question for a process computer - use a static address.

I dont have a poor connection and still dont use DHCP, DNS lookup,
wins and whatever..., all static,
I put the server address in the startup file for clients connecting -
dont trust dhcp,dns and others to be up, they are from redmond...
//CY
Dec 30 '07 #4
<ch*******@gmail.comwrote in message
news:63**********************************@l32g2000 hse.googlegroups.com...
>
If you _do_ do it explicitly, then yes...I believe none of your
already-created sockets will work.
Yes I think that is correct, the nice thing is DHCP-leases as long as
connected they renew before they release (somhwere in my head a thing
like when 2/3 of lease time has expired)
so theoretically if you have a really poor connection and want this to
be a non question for a process computer - use a static address.

I dont have a poor connection and still dont use DHCP, DNS lookup,
wins and whatever..., all static,
I put the server address in the startup file for clients connecting -
dont trust dhcp,dns and others to be up, they are from redmond...
//CY
Please don't apply for a network admin anywhere with a medium to large
network. DHCP/DNS are vital to large networks.

Mike.
Dec 30 '07 #5
TheMadHatter wrote:
Quick q:

If I open a socket on my computer and eventualy
the dhcp changes the address of my computer, what happens?
Will it drop the connection?
Of course it will. You can test this yourself by simply ensuring you
have a connection and then doing ipconfig /release to release your IP.
It will reset all connections because everything attached to them is
based on invalid addresses.

As Michael said though, you generally won't have this problem unless
you're talking about being on a broadband connection with a provider who
really likes to change your IP on you. On Home/Corporate networks this
generally isn't an issue at all.
Chris.
Dec 31 '07 #6
dont trust dhcp,dns and others to be up, they are from redmond...
//CY
Please don't apply for a network admin anywhere with a medium to large
network. DHCP/DNS are vital to large networks.
Also they are not from Microsoft, they are IETF standards. If the Microsoft
server implementation isn't reliable, then use another one.
Dec 31 '07 #7
Please don't apply for a network admin anywhere with a medium to large
network. *DHCP/DNS are vital to large networks.

Also they are not from Microsoft, they are IETF standards. *If the Microsoft
server implementation isn't reliable, then use another one.
Correct, but why use one at all when I am talking about 30
computers... static is not a problem here...

//CY
Jan 4 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Richard D. Ford | last post: by
5 posts views Thread by Steve | last post: by
2 posts views Thread by WhatHappend | last post: by
5 posts views Thread by Richard | last post: by
reply views Thread by GHUM | last post: by
1 post views Thread by Screenbert | last post: by
reply views Thread by screenbert@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.