You can try to use "open" field for this purpose, because it can be happen that "socket" is not in "Conn. established" state (for example state=5, FIN segment sent), but socket is still busy (open = 0).
Looking at an open condition seems to be working, thanks.
Can you tell me did you go to "Net_Ethernet_28j60_UserTCP" function after sending a dummy ACK? If I understand your question correctly, you just need to form proper GET request and put into in Tx buffer (inside "Net_Ethernet_28j60_UserTcp").
I'm doing everything correct, I believe it has something to do with the port of the site I'm trying to obtain data from.
I do need some advice on getting larger than the windows requests. I have the :
Code: Select all
onst unsigned int MY_MSS_28j60 = 100; // Our maximum segment size.
windows set to 100 bytes, but on a particularly large form I'm serving, has 400 bytes on the submit. How can I break up the request into multiples? You had volunteered an example, but haven't seen one yet. Any chance of getting one?
I'll share with the world my function for retrieving the request:
Code: Select all
static DListElmt *initSocket(SOCKET_28j60_Dsc *socket)
{
socket_t *currentS;
char termination = 0;
char request[REQUESTLIM+1];
int i = 0;
if(dlist_size(&socketList) >= NUM_OF_SOCKET_28j60-1) // See if there is room in the list
return 0;
// Get request, terminate after 2 \n char
do {
request[i] = Net_Ethernet_28j60_getByte();
if(request[i] == '\n')
termination++;
i++;
} while(termination < 2 && i < (REQUESTLIM));
request[i] = '\0'; // Add a terminating null to string
if(memcmp(request, "GET", 3) != 0 && (socket->state != 3)) // !GET request or state !3 return
return 0;
if((currentS = (socket_t*)Malloc(sizeof(socket_t))) == 0) // Lets try to allocate some memory
return 0;
strcpy(currentS->requests.rawRequest, request); // Copy request onto socket struct
currentS->s = socket; // Assign socket
currentS->socketSM = SM_HTTP_PARSE_REQUEST; // Set the state machine to ready for parsing
dlist_ins_prev(&socketList, dlist_head(&socketList), currentS); // Adds element to the head of the list
return socketList.find(socket);
}
Alot of it won't make sense since I'm using some unlisted structs and a linked list to store all my active sockets in, but you can see from the do / while loop, that is where I am reading the request. I terminate the loop when I have a complete 2 lines or limit is reached.