• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

UNIX programming

AznMaverick

Platinum Member
I've been looking on google, but i haven't been able to find good source code on how to program basically a telnet session. Primarily i would just like to be able to connect to a remote system, send data (ascii string is fine), it would be a bonus to be able to receive data. How do i go about doing this?.

Thanks for your help!
 
Two threads, one reads stdin and writes it to the socket, one reads the socket and writes it to stdout (or alternative files, if you so choose). It's pretty simple.
 
Originally posted by: kamper
Two threads, one reads stdin and writes it to the socket, one reads the socket and writes it to stdout (or alternative files, if you so choose). It's pretty simple.

Threads aren't very "unixy."

Besides being evil. 😛

(actually, probably *because* they're evil)
 
Originally posted by: BingBongWongFooey
Originally posted by: kamper
Two threads, one reads stdin and writes it to the socket, one reads the socket and writes it to stdout (or alternative files, if you so choose). It's pretty simple.

Threads aren't very "unixy."

Besides being evil. 😛

(actually, probably *because* they're evil)
Better than polling...
 
Originally posted by: kamper
Originally posted by: BingBongWongFooey
Originally posted by: kamper
Two threads, one reads stdin and writes it to the socket, one reads the socket and writes it to stdout (or alternative files, if you so choose). It's pretty simple.

Threads aren't very "unixy."

Besides being evil. 😛

(actually, probably *because* they're evil)
Better than polling...

select()
 
Sorry, I guess I don't spend enough time browsing around for c api documentation 😛

otoh, "man select" told me everything I needed to know 😱
 
Back
Top