MFEM v2.0
isockstream.hpp
Go to the documentation of this file.
00001 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
00002 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
00003 // reserved. See file COPYRIGHT for details.
00004 //
00005 // This file is part of the MFEM library. For more information and source code
00006 // availability see http://mfem.googlecode.com.
00007 //
00008 // MFEM is free software; you can redistribute it and/or modify it under the
00009 // terms of the GNU Lesser General Public License (as published by the Free
00010 // Software Foundation) version 2.1 dated February 1999.
00011 
00012 #ifndef MFEM_ISOCKSTREAM
00013 #define MFEM_ISOCKSTREAM
00014 
00015 #include <sstream>
00016 using namespace std;
00017 
00023 class isockstream
00024 {
00025 private:
00026    int portnum, portID, socketID, error;
00027    char *Buf;
00028 
00029    int establish();
00030    int read_data(int socketid, char *buf, int size);
00031 
00032 public:
00033 
00036    explicit isockstream(int port);
00037 
00038    bool good() { return (!error); }
00039 
00041    void receive(istringstream **in);
00042 
00044    ~isockstream();
00045 };
00046 
00047 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines