- // port
- ch->set_port_str( config.substr(begin) );
- FG_LOG( FG_IO, FG_INFO, " port string = " << ch->get_port_str() );
+ // port string
+ end = config.find(",", begin);
+ if ( end == string::npos ) {
+ return NULL;
+ }
+
+ string port = config.substr(begin, end - begin);
+ begin = end + 1;
+ FG_LOG( FG_IO, FG_INFO, " port string = " << port );