[SDL] What's the better way to "suspend" the networking?
Miguel Pragier
pragier at gmail.com
Fri Aug 3 14:54:47 PDT 2007
A very simple and obvious thing in your message that I never though before:
To ask the server to stop send messages.
And this will be my solution.
I'm getting older. Thank you.
M.P.
2007/8/3, James Buchwald <jamestheprogrammer at gmail.com>:
>
> What exactly do you mean by "suspend the networking"? Are you talking
> about not processing any packets for a time, or actually having the remote
> computer stop sending to you until you notify?
>
> Simply deleting the socket from the set won't stop incoming traffic, it
> will just stop you from processing until you put it back in the set (and
> then you'll have everything to process). I'm a bit unclear about how the TCP
> stack and the OSI layers work, but I think you'll still be using bandwidth,
> just not quite as much processing power (correct me if I'm wrong).
>
> You should almost never have to actually close the socket... depending on
> how often you suspend, this might take quite a bit. Of course, if you're
> talking about something that's primary function does NOT involve the
> network, and you're not going to be doing anything with the network for a
> few minutes (or longer) until the user does something, then closing the
> socket is ok...
>
> For short bursts of suspending the network without making things
> reconnect, though, you could always send a packet that asks the remote
> computer to stop sending. Sure, if it's a hacker, it won't stop, but then
> you can close the socket.
>
> On 8/3/07, Miguel Pragier <pragier at gmail.com> wrote:
>
> > A SDLNet question.
> >
> > To suspend for a few moments the networking, what would be the best way?
> >
> > To delete the socket from the set? ( Then after, to add it again. )
> > To close the socket? ( Then after, to reopen the connection. This seems
> > the worst )
> >
> > Or to receive the packets and ignore?
> >
> > Or other method which do not occurs me?
> >
> >
> >
> > M.P.
> >
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
> >
>
>
> --
> "If you see somebody who you don't know getting into a crop duster that
> doesn't belong to you, report them." -- President George W. Bush
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070803/e312b1f7/attachment.htm>
More information about the SDL
mailing list