linux - C Send Socket without Defining Socket -


what line of code do

send(4, "test\n", 15, 0); 

if there no socket defined in code?

it fails, ebadf error (in errno).

see manual page more possible error values.

note could succeed, if there code before sets socket hardcoded descriptor value of 4 (the first argument). see dup() function 1 way of attempting that.

also note parent process doing setup, might not visible in source file silently assumed.

finally note undefined behavior due reading outside provided buffer (the string isn't 15 characters long). pretty suspect code.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -