Commit Graph

6 Commits

Author SHA1 Message Date
lpleahy b497a8a894 Fix listen exit path when last port returns an error.
Signed-off-by: lpleahy


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13466 6f19259b-4bc3-4df7-8a09-765794883524
2012-06-22 21:46:55 +00:00
lpleahy 44538ba5aa Fix port retry behavior during connect - All port error paths exit through ConnectComplete to try the next port. When the last port fails to connect, the port error status to errno translation gets done by ConnectPoll.
Testing:
Using two network adapters, second one always connected to the network.

1. Eth0 not configured, not connected - short delay
2. Eth0 not configured, connected - short delay
3. Eth0 configured, not connected - short delay
4. Eth0 configured, connected to private network - long delay due to connection timeout, failover to Eth1
5. Eth1 configured, connected, no server - long delay due to connection timeout, returned timeout error.


Signed-off-by: lpleahy

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13436 6f19259b-4bc3-4df7-8a09-765794883524
2012-06-08 20:53:12 +00:00
lpleahy 3a2fc8780f Only use ports with a network connection (media present) when connecting to a remote host.
Fix bug causing early exit with NO_MEDIA.
Add fix to TCP6.

Signed-off-by: lpleahy


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13432 6f19259b-4bc3-4df7-8a09-765794883524
2012-06-07 17:38:09 +00:00
lpleahy fcb6f89d01 Fix read issue detected by the following Python program. The issue was that the caller's buffer pointer was not being advanced between segments of the read data.
Signed-off-by: lpleahy

-----  UnbufferedRead.py  -----

import httplib
conn = httplib.HTTPConnection("10.241.97.30")
conn.request('GET', '/')
resp = conn.getresponse(buffering=True)
if resp.status != 200:
   print "status:", resp.status
   print "aborting"
   sys.exit(1)
while True:
   chunk = resp.read()
   if not chunk:
       break
   print chunk


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13077 6f19259b-4bc3-4df7-8a09-765794883524
2012-03-05 19:05:47 +00:00
lpleahy f74dc4bbba 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
2012-02-24 18:45:09 +00:00
lpleahy 3bdf9aae5f Merged socket development branch:
* Fixed bug report (Duane Voth: Python sockets test application not working) by starting the receive operations when a connection is established!
* Increased performance by extending the idle loop into the network stack with the Poll call.
* Added support for TCPv6 (SOCK_STREAM) and UDPv6 (SOCK_DGRAM).
* Added support for getaddrinfo and getnameinfo calls.
* Moved application PCD values into AppPkg

Signed-off-by: lpleahy

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13002 6f19259b-4bc3-4df7-8a09-765794883524
2012-02-09 19:16:44 +00:00