Outils pour utilisateurs

Outils du site


serveur_minitel_web

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révisionLes deux révisions suivantes
serveur_minitel_web [2019/06/20 13:10] – [Openframeworks] Mushussuserveur_minitel_web [2019/06/25 09:54] Mushussu
Ligne 37: Ligne 37:
 https://medium.com/@martin.sikora/libwebsockets-simple-websocket-server-68195343d64b https://medium.com/@martin.sikora/libwebsockets-simple-websocket-server-68195343d64b
 <code c> <code c>
-// gcc -Wall ServeurMinitelWeb.c -o ServeurMinitelWeb -Llibwebsockets/build/lib -lwebsockets+// gcc -Wall testServeur.c -o testServeur -lwebsockets
  
  
Ligne 47: Ligne 47:
 lws_callback_http( lws_callback_http(
                                      
-                         struct lws *wsi, +                  struct lws *wsi, 
-                         enum lws_callback_reasons reason, +                  enum lws_callback_reasons reason, 
-                         void *user, +                  void *user, 
-                         void *in, +                  void *in, 
-                         size_t len +                  size_t len 
-                         ) {+                  ) {
     switch (reason) {     switch (reason) {
         case LWS_CALLBACK_ESTABLISHED:         case LWS_CALLBACK_ESTABLISHED:
Ligne 66: Ligne 66:
                 ((char *) in)[i];                 ((char *) in)[i];
             }             }
 +            
             printf("received data: %s, replying: %.*s\n", (char *) in,             printf("received data: %s, replying: %.*s\n", (char *) in,
                    (int) len, buf + LWS_SEND_BUFFER_PRE_PADDING);                    (int) len, buf + LWS_SEND_BUFFER_PRE_PADDING);
 +            
             lws_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING],             lws_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING],
-                               len, LWS_WRITE_TEXT);+                      len, LWS_WRITE_TEXT);
             free(buf);             free(buf);
             break;             break;
serveur_minitel_web.txt · Dernière modification : 2020/04/13 12:52 de Mushussu