EVB-PIC24 WIZnet, EVB-PIC24 Datasheet - Page 65

no-image

EVB-PIC24

Manufacturer Part Number
EVB-PIC24
Description
Development Boards & Kits - PIC / DSPIC W3150A+EVAL BOARD BASED ON PIC24
Manufacturer
WIZnet
Datasheet

Specifications of EVB-PIC24

Rohs
yes
Product
Development Kits
Interface Type
RS-232
Data Bus Width
16 bit
Dimensions
50 mm x 40 mm
Since web_server() is TCP server program is built in the similar way as loopback_tcps() as explained in
Chapter
web_server() calls proc_http() that processes HTTP request message from web browser at
SOCK_ESTABLISHED of the http socket.
After calling function proc_http(), it waits until the HTTP Response message about HTTP Request from web
browser, and then calls disconnect() to close the http socket.
This socket close is called Active Close and, in the case, EVB B/D requests the close to the client first. For
your reference, Passive Close is where client requests disconnection first. The reason why web server
program supports Active Close is that EVB B/D support to connect other client‟s connection.
Declare & Initialize Local Variables
u_char * http_request = RX_BUF
SOCK_ESTABLISHED
SOCK_CLOSE_WAIT
Check Socket Status
3.2.6.1. Difference between web_server() and loopback_tcps() is in the data communication codes.
SOCK_CLOSED?
getSn_SR(ch)
web_server()
?
?
N
N
© Copyright 2006 WIZnet Co., Inc. All rights reserved.
Y
Y
Y
socket(ch,Sn_MR_TCP,port,0x00)
len = getSn_RX_RSR(ch)
Wait a connetion with a client
Get Recieved Size
Create a TCP Socket
<Fig 3.18: web_server()>
disconnect(ch)
Close Socket
RETURN
listen(ch)
len > 0
N
Y
http_proc(ch,http_request,len)
Process the HTTP Message
Wait for sending the HTTP
recv(ch,http_request,len)
Response completely
Receive the Data
disconnect(ch)
Close Socket
55

Related parts for EVB-PIC24