Re: Functions in socket
- From: Ulrich Eckhardt <doomster@xxxxxxxx>
- Date: Sat, 31 Mar 2007 09:54:29 +0200
nick048 wrote:
Now, I need to pass from a client (example telnet) a phrase[...]
(multiline) terminated by "..".
if ((fd = accept(sock, (struct sockaddr *)&client, &client_len)) < 0)[...]
receive_phrase(fd, fd);[...]
close(fd);
Can You suggest me how create the function receive_phrase terminated
with "..".
Tough. I can't imagine a function that requires passing the same argument
twice. ;)
Anyhow, let's sum up what you need:
1. A way to signal errors like e.g. a broken connection or allocation
failure.
2. A way to pass out arbitrary amounts of dynamically allocated data and
their length.
If you have that, the rest is just implementing it.
BTW: read the FAQ about homework.
Uli
.
- References:
- Functions in socket
- From: nick048
- Functions in socket
- Prev by Date: Functions in socket
- Next by Date: OT - Re: Looking for a *FAST* graphics library More options
- Previous by thread: Functions in socket
- Next by thread: Re: Functions in socket
- Index(es):