]> rtime.felk.cvut.cz Git - mf6xx.git/blobdiff - src/qemu/mf624_interface/untitled/socket_thread.cpp
Passing port number to Qt interface as commandline argument now works.
[mf6xx.git] / src / qemu / mf624_interface / untitled / socket_thread.cpp
index 44246d9371040dede44cfaf8ae243b0de8fefe46..d10e8cc26d9bf7f8ad6fa06dea094996a44d5a13 100644 (file)
@@ -38,7 +38,7 @@ void socket_thread::socket_send(const char* str, int val)
 void socket_thread::run()
 {
 #define STRING_BUFF_SIZE       256
-       qDebug() << "Executing in new independant thread, GUI is NOT blocked";
+       //qDebug() << "Executing in new independant thread, GUI is NOT blocked";
 
        int portno;
        int n;
@@ -50,12 +50,7 @@ void socket_thread::run()
        int val;
        char buffer[256];
 
-       //if (argc < 3) {
-       //   fprintf(stderr,"usage %s hostname port\n", argv[0]);
-       //   exit(0);
-       //}
-       //portno = atoi(argv[2]);
-       portno = atoi("55555");
+
 
        sockfd = ::socket(AF_INET, SOCK_STREAM, 0);
        if (sockfd < 0) {
@@ -76,9 +71,10 @@ void socket_thread::run()
             (char *)&serv_addr.sin_addr.s_addr,
             server->h_length);
 
-       serv_addr.sin_port = htons(portno);
+       serv_addr.sin_port = htons(mf624_io_status.portno);
        if (::connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {
                perror("connect()");
+               ::exit(1);
        }