TCP/IP communication over USB?????

Discussion in 'Computing and Networks' started by skysurf, Apr 1, 2007.

  1. skysurf

    Thread Starter Member

    Oct 20, 2005

    I am working on a small project in which I am trying to develop a simple C program using MS Visual Studio 2005.

    The goal of the program is to communicate via sockets and TCP/IP to a stand-alone TFT, over a USB cable. So my question:

    I am looking at using WinSock in the C program to communicate via TCP/IP. Can WinSock be used for TCP/IP communication over a USB port of the computer instead of the regular ethernet port?? If so, how?? I have an example code using Winsock such as follows:

    struct sockaddr_in server_address;
    // Initialise server address structure.
    int init = WSAStartup( MAKEWORD( 2, 2 ) , &WSAData );
    char *) &(server_address), 0, sizeof(server_address));
    server_address.sin_family = AF_INET;
    server_address.sin_port = htons(SERVER_TCP_PORT);
    server_address.sin_addr.s_addr = htonl(SERVER_IP_ADDRESS);
    // Create socket.
    server_socket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP );
    // Connect to server socket.
    if (connect
    struct sockaddr *) &(server_address),
    ) < 0)

    How can I specify for the USB port to be used in such code??
    Would appreciate any help as I am very new to Windows and Network programming!!!! Thanks!!!! :)

  2. Papabravo


    Feb 24, 2006
    I pretty sure that "simple C program", TCP/IP, and USB don't belong in the same paragraph. When you consider that the TCP/IP stack can hardly be supported in an original PC with 640K of memory you begin to understand the complexity of these things. I'm not saying it is impossible, just that it will be neither inexpensive nor simple to research, code, debug, and test. But good Luck - knock yourself out.