Welcome! Log In Create A New Profile

Advanced

How to close a network?

Posted by linyip05 
How to close a network?
April 22, 2009 01:22AM
Hi,

I saw a lot of examples about initializing a network. However, I could not find any tutorial about closing a network.

In network.h, i saw two functions which might be the function to call, but i don't understand the argument at all:

net_shutdown(s32 s, u32 how)
net_close(s32)

Any comment?

Thanks
Re: How to close a network?
April 22, 2009 07:26AM
The documentation authors think that it's so incredibly obvious that the barely named parameter is for the socket handle.
Re: How to close a network?
April 22, 2009 10:00AM
Thanks!

Can you give me some direction? I don't have any experience of network programming.

If I used net_init() and then downloaded some files, and now want to use net_shutdown(), what parameters should i passed into the function?
Re: How to close a network?
April 22, 2009 03:22PM
As I just told you, the "s" parameter is a socket handle. If you can't guess what socket handle that you should pass, please stop trying to do network coding, you clearly don't know what you are doing.

For the how? I think it's a bitflag field, look in network.h for the constants to OR together. Of course, this implies that you understand what they are supposed to do. I sure don't.



Edited 1 time(s). Last edit at 04/22/2009 03:23PM by henke37.
Re: How to close a network?
April 22, 2009 04:59PM
Quote
henke37
please stop trying to do network coding, you clearly don't know what you are doing.

He never will know what he's doing if he never tries...
Re: How to close a network?
April 26, 2009 12:33AM
Quote
profetylen
Quote
henke37
please stop trying to do network coding, you clearly don't know what you are doing.

He never will know what he's doing if he never tries...

Yes, perhaps the better thing henke could've said is please read up on network theory before trying network coding, as you should know something about it before you start coding. But his point remains the same.
Sorry, only registered users may post in this forum.

Click here to login