telnet and OOB data
Darren Reed
avalon at coombs.anu.edu.au
Mon Jul 1 01:28:25 AEST 1991
G'day, I'm trying to write a program which will run on a port and
is accessed by telnetting to that port. All the socket stuff is
ok (binds, listens, accepts, forks, etc) but it seemed that something
was missing when everything i typed appeared twice. Now it seems
that telet always ECHOs you input unless you tell it to turn off
(and various other modes too) and this is done using OOB data.
fine, so i grabbed telnet/telnetd source code to have a look at how
OOB data is done...yuck. I tried to implement something to send
some OOB commands for telnet but doing this only locked up the
telnet session. :-/ What is the correct way to use send() and OOB ?
I did something like this:
int fd;
char oob_cmd, buffer[any_size_you_like];
...
setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, 1, sizeof(int));
...
send(fd, buffer, strlen(buffer), 0);
send(fd, &oob_cmd, 1, MSG_OOB);
Also, if i use OOB data, will OOB commands sent back to me from telnet
stop other data from flowing until the OOB data has been cleared ?
There is very little info about this in the manuals save a few
references to OOB data in recv(2), send(2) and various other places
where its an option or something.
Does anybody know how I should be going about telling telnet *not*
to ECHO, etc ?
thanks,
-avalon
More information about the Comp.unix.programmer
mailing list