Hack Forums
[C] Debugging a issue with socket programming - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] Debugging a issue with socket programming (/showthread.php?tid=5976116)



Debugging a issue with socket programming - Truth3356 - Jun 2, 2019

Im trying to code a client/server socket setup , everything compiled fine, but i try to run the server and i get "setsockopt : Protocol not found" heres a link to my code :https://pastebin.com/6rL4vnBs


RE: Debugging a issue with socket programming - root_ff - Jun 2, 2019

hi,

i don't thinks you put a right argument when you call function setsockopt.
can you please check in man 3 setsockopt


RE: Debugging a issue with socket programming - Truth3356 - Jun 2, 2019

(Jun 2, 2019 09:41 PM)root_ff Wrote:  hi,

i don't thinks you put a right argument when you call function setsockopt.
can you please check in man 3 setsockopt

When you say man 3 is this what you are referring to :
https://linux.die.net/man/3/setsockopt


RE: Debugging a issue with socket programming - root_ff - Jun 2, 2019

yes or open your terminal and just put man 3 setsockopt


RE: Debugging a issue with socket programming - Truth3356 - Jun 2, 2019

(Jun 2, 2019 09:51 PM)root_ff Wrote:  yes or open your terminal and just put man 3 setsockopt

Thank you sir, will let you know how this goes


RE: Debugging a issue with socket programming - root_ff - Jun 2, 2019

you should have root privilege

please check this example ----> pastebin . com/ YSiMThRn


RE: Debugging a issue with socket programming - Truth3356 - Jun 2, 2019

(Jun 2, 2019 09:59 PM)root_ff Wrote:  you should have root privilege

please check this example  ----> pastebin . com/ YSiMThRn

Okay, thank you


(Jun 2, 2019 09:59 PM)root_ff Wrote:  you should have root privilege

please check this example  ----> pastebin . com/ YSiMThRn

This worked, i tweaked it a little bit based on the paste bin link you gave me, but overall the code looks different than whats in the pastebin, thanks man