@@ -108,7 +108,7 @@ static void on_general_message(MessageType type)
108108 int sz = msg_write ((char *)&msg, sizeof (msg));
109109 if (sz != sizeof (msg)) {
110110 log_conn (" stopped." );
111- gSspClient ->stop ();
111+ // gSspClient->stop();
112112 gLoop ->quit ();
113113 }
114114}
@@ -130,7 +130,7 @@ static void on_video(imf::SspH264Data *video)
130130 free (msg);
131131 if (sz != len) {
132132 log_conn (" stopped." );
133- gSspClient ->stop ();
133+ // gSspClient->stop();
134134 gLoop ->quit ();
135135 }
136136}
@@ -151,7 +151,7 @@ static void on_audio(imf::SspAudioData *audio)
151151 free (msg);
152152 if (sz != len) {
153153 log_conn (" stopped." );
154- gSspClient ->stop ();
154+ // gSspClient->stop();
155155 gLoop ->quit ();
156156 }
157157}
@@ -186,7 +186,7 @@ static void on_meta(imf::SspVideoMeta *vmeta, struct imf::SspAudioMeta *ameta,
186186 free (msg);
187187 if (sz != len) {
188188 log_conn (" stopped sz != len %d != %d." , sz, len);
189- gSspClient ->stop ();
189+ // gSspClient->stop();
190190 gLoop ->quit ();
191191 }
192192}
@@ -206,7 +206,7 @@ static void on_exception(int code, const char *description)
206206 if (sz != len) {
207207 log_conn (" exception error." );
208208 }
209- gSspClient ->stop ();
209+ // gSspClient->stop();
210210 gLoop ->quit ();
211211}
212212
@@ -226,7 +226,7 @@ static void setup(imf::Loop *loop)
226226 std::bind (on_general_message, RecvBufferFullMsg));
227227 client->setOnDisconnectedCallback ([=]() {
228228 on_general_message (DisconnectMsg);
229- client->stop ();
229+ // client->stop();
230230 loop->quit ();
231231 });
232232 client->start ();
@@ -238,7 +238,7 @@ static void setup(imf::Loop *loop)
238238
239239 if (sz != sizeof (msg)) {
240240 log_conn (" stopped." );
241- client->stop ();
241+ // client->stop();
242242 gLoop ->quit ();
243243 }
244244}
@@ -254,6 +254,7 @@ int main(int argc, char **argv)
254254 _setmode (_fileno (stdout), O_BINARY );
255255#endif
256256 setvbuf (stdout, NULL , _IONBF, 0 );
257+ setvbuf (logfile, NULL , _IONBF, 0 );
257258 // setbuf(stdout, nullptr); // unbuffered stdout
258259
259260 log_conn (" host: %s\n port: %d\n uuid: %s\n " , address, port, uuid);
@@ -263,9 +264,10 @@ int main(int argc, char **argv)
263264 setup (gLoop );
264265 loop->loop ();
265266 log_conn (" loop finished" );
267+ // gSspClient->stop();
266268 delete loop;
267- if (gSspClient ) {
268- delete gSspClient ;
269- }
269+ // if (gSspClient) {
270+ // delete gSspClient;
271+ // }
270272 return 0 ;
271273}
0 commit comments