socket-stream-C++

socket-stream-C++

Post by Alvin Poo » Tue, 16 Mar 1999 04:00:00



Hi,

Got a question regarding the use of sockets in C++ with streams...

I have attempted the following:

1. established a socket by call socket() and connect() (to an echo port,
BTW).
2. used the file descriptor returned by socket() to create an instance of
ifstream and an instance of ofstream.
3. sent something to the ofstream, and received the same stuff on ifstream.

so far so good...

but when I tried using only a single fstream object, I couldn't receive the
echoed stuff.

So my questions are:

1. is it possible to use a single fstream to gain access to an opened
socket?
2. is this approach workable?  I figured that specific socket operations can
be accomplished by calling C functions to fine-tune...

BTW, I tried this on Digital Unix 3.2c.

Thanks in advance.

 
 
 

1. How to push STREAMS module into socket stream

I understand that the kernel network subsystem is implimented as
STREAMS. So socket in this sense is also implemented as STREAMS.
I created a streams module and tried to push the module between IP and
TCP. The xx_open and xx_close of the streams module is called but the
xx_put function never gets called. An ioctl (..I_LIST) shows that the
module IS pushed into the socket stream.

can anyone help me with this. I need to push a STREAMS module between
TCP and IP(IP and network driver).

Thanks

Sent via Deja.com http://www.deja.com/
Before you buy.

2. How to get glx to work in direct mode???

3. My stream socket vs message queue test results...

4. Reset after shutdown

5. Socket problem, streaming data

6. Setup problem!@

7. Help: sockets -> streams in C++

8. xconsole on AIX 3.2.3

9. Internet stream sockets

10. TCPIP Stream Socket losing data - Solaris 2.3

11. Socket Stream 4K data limit.

12. socket streams, listen(), accept() and connect().

13. Streams or Sockets?