Example #1
0
            void JSocketHandler::connect(){
                if (port == 0) {
                    throw new JIllegalArgumentException("Bad port: 0");
                }
                if (host == NULL) {
                    throw new JIllegalArgumentException("Null host name: ");
                }

                sock = new JSocket(*host, port);
                JOutputStream* out = sock->getOutputStream();
                JBufferedOutputStream* bout = new JBufferedOutputStream(out);
                setOutputStream(bout);
            }
Example #2
0
JSONStringer::JSONStringer() :
    JSONWriter(),
    _oss(std::make_unique<asciistream>())
{
    setOutputStream(*_oss);
}