Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- catch (SocketException se)
- {
- //Console.WriteLine("SocketException : {0}", se.ToString());
- //Console.WriteLine("Codice errore numero:" + se.ErrorCode);
- if ((SocketError)se.ErrorCode == SocketError.ConnectionAborted)
- {
- //Console.WriteLine("SocketException GESTITA: CONNECTION ABORTED HANDLED");
- if (listenerString != null)
- {
- listenerString.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
- }
- return;
- }
- if ((SocketError)se.ErrorCode == SocketError.AddressAlreadyInUse)
- {
- Console.WriteLine("ERRORE:AddressAlreadyInUse");
- //MessageBoxResult retry = System.Windows.MessageBox.Show("AddressAlreadyInUse: click ok to try again.", "Errore");
- listenerString.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
- ThreadStart ThreadStringa = delegate()
- {
- this.RiceviStringa(new DelegateStringCopy(CopyToClipboard));
- };
- fileThread = new Thread(ThreadStringa);
- fileThread.Start();
- }
- if ((SocketError)se.ErrorCode == SocketError.ConnectionReset)
- {
- Console.WriteLine("ERRORE:ConnectionReset Handled");
- //MessageBoxResult retry = System.Windows.MessageBox.Show("AddressAlreadyInUse: click ok to try again.", "Errore");
- listenerString.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
- ThreadStart ThreadString = delegate()
- {
- this.RiceviStringa(new DelegateStringCopy(CopyToClipboard));
- };
- fileThread = new Thread(ThreadString);
- fileThread.Start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement