Not logged in. · Lost password · Register
Forum: agsXMPP SDK Support RSS
Avatar
cso #1
Member since Dec 2005 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Stopping and starting the server
Hi!

I'm extending your server exampel. I'm trying to start and stop the server and then start the server again. I get the following error: "System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted"

I've tried closing the socket onServerStop(), I'v tried closing it onServerStart(). I've tried aborting the thread onServerStart(). Nothing seams to help.

Any ideas how to restart the server?
Avatar
Alex #2
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi,

this error message means that you try to open 2 listening sockets on the same port/ip at the same time.
So the server is not stopped correctly when you restart it.
This is only a small sample to show how you could write a server with agsXMPP. But if you want to write a server based on the library you would need complete new socket code and cannot reuse this code.
When i have some minutes then i try to write a better sample which supports start and stop correctly

Alex
Alexander Gnauck
AG-Software
Avatar
cso #3
Member since Dec 2005 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Stopping correctly
Hi!

I'm still having the same problem, and my boss is giving me a hard time about it. I was wondering if you have improved the server sampel with starting and stopping?
Avatar
Alex #4
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello cso,

no we didnt improve the sample yet.
If you want to write a XMPP server with our library you should be familar with .NET Sockets and asynchonous socket programming. There a lots of different ways how to implement the server sockets. This depends on the design of your server and how many concurrent connections you want to handle (10, 100, thousands or millions).
On Codeproject you will find lots of useful articles on sockets like this one:
http://www.codeproject.com/csharp/socketsincs.asp
You can also contact us for customized offers and development.

Alex
Alexander Gnauck
AG-Software
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP SDK Support RSS