Skip to content

The Multi-Socket Money Shot

February 16, 2016

16-02-16 succeed

There we are with receives done on two sockets! I stuck a 5 second wait in the processing of each turn to ensure the socket would be tied up when i entered a transaction from another browser window. I find it interesting how accommodating this setup is. I have the ethernet card hooked up directly to my windows laptop with static ip address 169.254.180.2. I’m able to address it with no other special arrangements or cabling.

My socket management is just the simplest sequential polling with only two sockets but it seems fine.

while(1){ // Loop forever
for(sock=0;sock<2;sock++){//loop through sockets in use
socketstatus=wizGetCtl8(SnSR,sock); //socket status
switch (socketstatus){
case SOCK_CLOSED: //initial condition

case SOCK_ESTABLISHED: //someone wants to talk to the server
SFWs=0;
handlesession(sock);
break;

}
tbrnd(); //cycle the generator
delay(50);
}//for (sock..
}//while(1)

[/sourcecode]

Advertisements

From → Olduino/Z, web server

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: