Hi,
I use the regular Arduino Ethernet shield
I'm trying to use this ~exact code in my arduino project.
It's C, must be easy to do.
I'm not very good with Socket programming already.
Thanks for the help.
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
int conn;
char sbuf[512];
int main() {
char *host = "some.domain";
char *port = "8080";
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
getaddrinfo(host, port, &hints, &res);
conn = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
connect(conn, res->ai_addr, res->ai_addrlen);
while ((sl = read(conn, sbuf, 512))) {
...
... do somthing here
...
}
}