Fix issues detected by python web-server.

* Removed display of TPL
* Added NOP implementation for SO_REUSEADDR
* Add better detection of socket address
* Return first address

Signed-off-by: lpleahy

Python Web server below:

---------------

import sys
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler


HandlerClass = SimpleHTTPRequestHandler
ServerClass  = BaseHTTPServer.HTTPServer
Protocol     = "HTTP/1.0"

port = 80
server_address = ('', port)

HandlerClass.protocol_version = Protocol
httpd = ServerClass(server_address, HandlerClass)

sa = httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1], "..."
httpd.serve_forever()




git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13034 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lpleahy
2012-02-24 18:45:09 +00:00
parent 287b4d32ee
commit f74dc4bbba
8 changed files with 82 additions and 65 deletions

View File

@ -989,9 +989,10 @@ typedef struct _ESL_SOCKET {
//
// Socket options
//
BOOLEAN bIncludeHeader; ///< TRUE if including the IP header
BOOLEAN bListenCalled; ///< TRUE if listen was successfully called
BOOLEAN bOobInLine; ///< TRUE if out-of-band messages are to be received inline with normal data
BOOLEAN bIncludeHeader; ///< TRUE if including the IP header
BOOLEAN bReUseAddr; ///< TRUE if using same address is allowed
//
// Socket data
@ -999,6 +1000,7 @@ typedef struct _ESL_SOCKET {
int Domain; ///< Specifies family of protocols
int Type; ///< Specifies how to make network connection
int Protocol; ///< Specifies lower layer protocol to use
BOOLEAN bAddressSet; ///< Set when the address is specified
BOOLEAN bConfigured; ///< Set after the socket is configured
BOOLEAN bRxDisable; ///< Receive disabled via shutdown