473,511 Members | 16,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asyncronous Socket and EndAccept()

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
1 4457
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7015
by: scott | last post by:
Hi all hope some one can help me with this prob because it is really annoying me and I can't seem to solve it. Just like to say thx to any one that can offer any help. Ok the prob. I have a...
1
6267
by: Chris Morse | last post by:
WARNING: Verbosity: skip to the very bottom paragraph for succinct version of my question.) Hi- I can't seem to find an answer to this. I am playing around with a variation of the ".NET...
2
6858
by: Macca | last post by:
My app has an asynchronous socket server. It will have 20 clients connected to the server. Each client sends data every 500 millisecondsThe Connections once established will not be closed unless...
3
2478
by: O.B. | last post by:
When sharing a Socket between threads, are the socket operations automatically synchronized to support multithreading? For example: Thread1 sets up a server socket to listen and invokes...
9
2271
by: =?Utf-8?B?aXdkdTE1?= | last post by:
Hi, im making an AIM like server using TCP sockets, however i found a big issue. when a socket is connected to (socket.EndAccept(ar)), its already bound to a Port. since its bound, i cannot change...
5
12751
by: darthghandi | last post by:
I've created a class to listen to all interfaces and do a BeginAccept(). Once it gets a connection, it passes the connected socket off and stores it in a List. Next, it continues to listen for...
10
5144
by: ThunderMusic | last post by:
Hi, I'm currently working with sockets. I accept connections using m_mySocket.Listen(BackLogCount); But when I want to stop listening, I shutdown all my clients and call m_mySocket.Close(), but it...
4
16052
by: O.B. | last post by:
I have a socket configured as TCP and running as a listener. When I close socket, it doesn't always free up the port immediately. Even when no connections have been made to it. So when I open...
4
3319
by: setiarakesh | last post by:
I have designed a socket Server and developed asynchronous server . It is working fine with 60 Clients which are connecting to ths Server running at Machine (2 GB RAM and OS is Windows 2003...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7355
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.