home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16160 < prev    next >
Encoding:
Text File  |  1992-11-12  |  1.6 KB  |  54 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!caen!nic.umass.edu!titan.ucc.umass.edu!mcrocker
  3. From: mcrocker@titan.ucc.umass.edu (MATTHEW S CROCKER)
  4. Subject: C++ sockets using iostream
  5. Message-ID: <BxM25M.30y@nic.umass.edu>
  6. Sender: usenet@nic.umass.edu (USENET News System)
  7. Organization: University of Massachusetts, Amherst
  8. Date: Thu, 12 Nov 1992 16:08:09 GMT
  9. Lines: 43
  10.  
  11.  
  12.  Is there currently a socket class derived from iostream so that
  13. I canr treat an socket like a stream??
  14.  
  15. example
  16.  
  17.  socketstream& mysock;
  18.  
  19.  mysock.open(titan.ucc.umass.edu,1234);
  20.  mysock << "this is a line of text to the socket" << endl;
  21.  mysock >> buf;
  22.  
  23.  cout << buf << endl;
  24.  
  25.  
  26. I would like to be able to further this class by adding object
  27. handling through the socket.
  28.  
  29. class message
  30. {  
  31.  private:
  32.   long messageID;
  33.  public
  34.  socketstream& operator<<(socketstream& st, message&);
  35. }
  36.  
  37. where the message class would send the messageID down (or object ID)
  38. which is unique.. on the other end of the socket the recieving client
  39. would see the messageID and know which object to assign the following
  40. data to that object would be responible for reading the data off of
  41. the stream in the same way it was written  (much like borlands
  42. resource's) I don't think that this would be too hard to do.. However
  43. I would just as soon not try to build something if there is currently
  44. a working version.
  45.  
  46. Thanks,
  47.  
  48. -Matthew S. Crocker
  49. -- 
  50. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  51. - Matthew Crocker
  52. s1949782@titan.ucc.umass.edu <-  Til 1/1/93
  53. mcrocker@titan.ucc.umass.edu <-  Til I Graduate  LOOOOOOOONNG TIME
  54.