char buf[3] = {"x","x","x"};
int main()
{
int s = socket(AF_INET, SOCK_STREAM, 0);
int b = bind(s, "127.0.0.1", 1025);
int error = listen(s, 5);
while(1)
{
if( int accept = accept(s) < 0 )
printf("Oshibka");
write(accept, buf, sizeof(buf));
//read(accept, buf, sizeof(buf));
}
return 0;
}
|