edit: You have a lot of junk in this code.
char *host = "127.0.0.1"; char *port = "8085";Should be const because it's read-only memory - You'll end up with segfaults if you forget that it's read-only.
You have redundant null-terminators in string literals, magic numbers everywhere, declaration and assignment are separated, unused variables (sbuf, etc...), and other issues.
Edited by 0xDEAD10CC, 13 February 2016 - 10:20 PM.