]> git.sesse.net Git - rdpsrv/blobdiff - rdpsrv.c
Check return value of mcs_recv_connect_initial().
[rdpsrv] / rdpsrv.c
index 045cf8db7fd40f58a415dd6b4e059df03fe3e5ad..c5b4169403f7ef271fa7f237e52257bae1925f28 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -16,8 +16,10 @@ int main()
 {
        int server_sock = create_server_socket();
        for ( ;; ) {
-               tcp_recv_connect(server_sock);
+               iso_recv_connect(server_sock);
+               printf("Got connection.\n");
                serve_client();
+               printf("Client closed.\n");
        }
 }
 
@@ -59,11 +61,16 @@ int create_server_socket()
 
 int serve_client()
 {
+       if (!mcs_recv_connect_initial())
+               error("MCS_CONNECT_INITIAL recv failed");
+       mcs_send_connect_response();
+       
        for ( ;; ) {
-               unsigned char buf[4096];
                short channel;
                
                /* receive ISO packets */
                mcs_recv(&channel);
+
+               printf("Packet on ch %u\n", channel);
        }
 }