--- projects/cms/source/host/c++/SubNet.cpp 2001/03/06 00:39:13 1.2 +++ projects/cms/source/host/c++/SubNet.cpp 2001/03/23 14:09:57 1.3 @@ -1,5 +1,12 @@ #include "SubNet.h" +SubNet::~SubNet(){ + + delete socket; + delete udp; + +} // ~SubNet + SubNet::SubNet(string host, int port){ // constructor @@ -28,8 +35,8 @@ SubNet::SubNet(){ string SubNet::sendTCP(string text){ - int size = 1024; - char buf[size]; + int size = 8192; + char buf[size]; (*socket) << text.c_str() << "\n" << flush; // @@ -42,21 +49,14 @@ string SubNet::sendTCP(string text){ void SubNet::sendUPDPacket( string host, int port, string message ){ - /* - host = "raptor.ukc.ac.uk"; - port = 7776; - */ + int udpSize; + udpSize = 8129; // 8kb in bits (8192*8) - int udpSize; - udpSize = 65536; // 8kb in bits (8192*8) - udp = new osockinet(sockbuf::sock_dgram); (*udp)->setopt(sockbuf::so_sndbuf , &udpSize, sizeof(udpSize), sockbuf::sol_socket); - // int sndBufSize = (*udp)->sendbufsz(udpSize); - - (*udp)->connect (host.c_str(), port); - (*udp) << message.c_str() << flush << endl; + (*udp)->connect (host.c_str(), port); + (*udp) << message.c_str() << flush; delete udp;