Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!rchen From: rchen@m.cs.uiuc.edu Newsgroups: comp.lang.c++ Subject: Re: TCP/IP in C++? Message-ID: <4800055@m.cs.uiuc.edu> Date: 18 Feb 89 05:50:00 GMT References: <4800053@m.cs.uiuc.edu> Lines: 39 Nf-ID: #R:m.cs.uiuc.edu:4800053:m.cs.uiuc.edu:4800055:000:1164 Nf-From: m.cs.uiuc.edu!rchen Feb 17 23:50:00 1989 /* Written 6:02 pm Feb 15, 1989 by bdale@hp-col.HP.COM in comp.lang.c++ */ > Unless it's purely for academic interest, re-implementing this stuff to take > advantage of C++'ish features seems a colossal waste of time... The layered network paradigm (ISO or TCP/IP), however, is a good example of showing off the beauty of C++ (too bad it's not written that way). Actually, I was looking for some kind of universally acceptable C++ interface of TCP/IP. The one I am using now (purely out of personal taste) is like following, foo() { // ... TCP_socket A("remote_task"); // open a direct link to a remote process UDP_socket B("p1", "p2"); // set up a conference with p1 and p2 // ... A.send(buffer, buffer_size); // throw at "her_task" (from "my_task") // ... date_size = B.recv(buffer2, buffer2_size); // from either "p1" or "p2" // ... } class TCP_socket { // ... TCP_socket(const char * partner_name); // ... } class UDP_socket { // ... UDP_socket(const char * partner_name1, ...); // ... } -Ron Chen @ Department of Computer Science University of Illinois at Urbana-Champaign