Author: gonzalo
Date: 2005-04-08 18:38:56 -0400 (Fri, 08 Apr 2005)
New Revision: 42715
Modified:
trunk/mcs/class/System/System.Net.Sockets/ChangeLog
trunk/mcs/class/System/System.Net.Sockets/Socket.cs
Log:
2005-04-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* Socket.cs: update socket connected status in an async request finishes
synchronously. Use 'callback' instead of 'real_callback' field, which is
now unused.
Modified: trunk/mcs/class/System/System.Net.Sockets/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/ChangeLog 2005-04-08 22:17:13 UTC
(rev 42714)
+++ trunk/mcs/class/System/System.Net.Sockets/ChangeLog 2005-04-08 22:38:56 UTC
(rev 42715)
@@ -1,3 +1,9 @@
+2005-04-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * Socket.cs: update socket connected status in an async request finishes
+ synchronously. Use 'callback' instead of 'real_callback' field, which is
+ now unused.
+
2005-04-07 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* Socket.cs: added SocketOperation enum and 2 new fields to
Modified: trunk/mcs/class/System/System.Net.Sockets/Socket.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/Socket.cs 2005-04-08 22:17:13 UTC
(rev 42714)
+++ trunk/mcs/class/System/System.Net.Sockets/Socket.cs 2005-04-08 22:38:56 UTC
(rev 42715)
@@ -77,7 +77,7 @@
bool completed_sync;
bool completed;
- AsyncCallback real_callback;
+ AsyncCallback real_callback; /* unused */
int error;
SocketOperation operation;
object ares;
@@ -87,7 +87,7 @@
this.Sock = sock;
this.handle = sock.socket;
this.state = state;
- this.real_callback = callback;
+ this.callback = callback;
this.operation = operation;
SockFlags = SocketFlags.None;
}
@@ -104,8 +104,8 @@
public void Complete ()
{
IsCompleted = true;
- if (real_callback != null)
- real_callback (this);
+ if (callback != null)
+ callback (this);
Queue queue = null;
if (operation == SocketOperation.Receive ||
operation == SocketOperation.ReceiveFrom) {
@@ -261,6 +261,7 @@
lock (result) {
try {
result.Sock.Connect
(result.EndPoint);
+ result.Sock.connected = true;
} catch (Exception e) {
result.Complete (e);
return;
@@ -805,15 +806,18 @@
Connect_internal (socket, serial, out error);
if (error == 0) {
// succeeded synch
+ connected = true;
req.Complete (true);
} else if (error != 10036 && error != 10035) {
// error synch
+ connected = false;
req.Complete (new SocketException
(error), true);
}
}
if (blocking || error == 10036 || error == 10035) {
// continue asynch
+ connected = false;
Worker worker = new Worker (req);
SocketAsyncCall sac = new SocketAsyncCall
(worker.Connect);
sac.BeginInvoke (null, req);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches