home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!caen!nic.umass.edu!titan.ucc.umass.edu!mcrocker
- From: mcrocker@titan.ucc.umass.edu (MATTHEW S CROCKER)
- Subject: C++ sockets using iostream
- Message-ID: <BxM25M.30y@nic.umass.edu>
- Sender: usenet@nic.umass.edu (USENET News System)
- Organization: University of Massachusetts, Amherst
- Date: Thu, 12 Nov 1992 16:08:09 GMT
- Lines: 43
-
-
- Is there currently a socket class derived from iostream so that
- I canr treat an socket like a stream??
-
- example
-
- socketstream& mysock;
-
- mysock.open(titan.ucc.umass.edu,1234);
- mysock << "this is a line of text to the socket" << endl;
- mysock >> buf;
-
- cout << buf << endl;
-
-
- I would like to be able to further this class by adding object
- handling through the socket.
-
- class message
- {
- private:
- long messageID;
- public
- socketstream& operator<<(socketstream& st, message&);
- }
-
- where the message class would send the messageID down (or object ID)
- which is unique.. on the other end of the socket the recieving client
- would see the messageID and know which object to assign the following
- data to that object would be responible for reading the data off of
- the stream in the same way it was written (much like borlands
- resource's) I don't think that this would be too hard to do.. However
- I would just as soon not try to build something if there is currently
- a working version.
-
- Thanks,
-
- -Matthew S. Crocker
- --
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- - Matthew Crocker
- s1949782@titan.ucc.umass.edu <- Til 1/1/93
- mcrocker@titan.ucc.umass.edu <- Til I Graduate LOOOOOOOONNG TIME
-