> > I wonder how should this be done?
> 
> With close().

maybe there's a way to play with setsockopt or something? however so far I
looked through Richard Steven's book, I haven't found anything.

> > but isn't it an overkill?
> 
> No. Unless you don't actually need to keep connecting and
> disconnecting that is.

ok. thanks. so close(sockfd) is equal to disconnecting it, right?
 
> > it every time) or it's save enough to do it once. (so far I haven't noted
> > connect does any mess with it, but... )
> 
> connect() shouldn't modify the `struct sockaddr'.
> 
> The prototype should have used `const struct sockaddr *', except that
> the `const' keyword didn't exist when the sockets API was developed.


hmm.. but I guess latter posix standard had it. right? (there's some kind
of mess with posix, posix.1g or something, what I still do not understand
well).

Reply via email to