By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,970 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,970 IT Pros & Developers. It's quick & easy.

asyncronous Socket and EndAccept()

P: n/a
title: asyncronous Socket and EndAccept()

question: hi to all, I am working with a server that uses the sockets in a
asyncronous way. When I want to STOP the server I do the following:
- serverMainSocket.EndAccept();
- serverMainSocket.Shutdown(SocketShutdown.Both);
- serverMainSocket.Close();
My problem is on the first instruction. I don't know what can I put as
argument in the EndAccept().

I've tried with

IAsyncResult asyn;
serverMainSocket.EndAccept(asyn);

but this is seen like an error.

Any ideas?

--
il RicercatoreSbadato
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

EndAccept() is used in your callback method for ending a connection request
for a socket in a listening state. It has nothing to do with closing the
socket. Remove the EndAccept() line and you're right on.

Good luck!

"il RicercatoreSbadato" wrote:
title: asyncronous Socket and EndAccept()

question: hi to all, I am working with a server that uses the sockets in a
asyncronous way. When I want to STOP the server I do the following:
- serverMainSocket.EndAccept();
- serverMainSocket.Shutdown(SocketShutdown.Both);
- serverMainSocket.Close();
My problem is on the first instruction. I don't know what can I put as
argument in the EndAccept().

I've tried with

IAsyncResult asyn;
serverMainSocket.EndAccept(asyn);

but this is seen like an error.

Any ideas?

--
il RicercatoreSbadato

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.