Hi,
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.
WSADATA WSAData;
int init = WSAStartup( MAKEWORD( 2, 2 ) , &WSAData );
memset((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
(
server_socket,
(struct sockaddr *) &(server_address),
sizeof(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!!!!
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.
WSADATA WSAData;
int init = WSAStartup( MAKEWORD( 2, 2 ) , &WSAData );
memset((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
(
server_socket,
(struct sockaddr *) &(server_address),
sizeof(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!!!!