473,815 Members | 2,537 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TcpListener.Sta rt() segfaults

I have a TcpListener that gets started from a GUI button event
handler:

TcpListener listener;
listener = new TcpListener(IPA ddress.Any, 1234);
listener.Start( backLog);

As soon as the third line runs, the app freezes, the CPU goes to 100%
on that CPU (Core Duo) and debugging can't break out of it. I can't
even stop the process with the Task Manager but have to reboot to get
it to stop.

Any ideas what's wrong? This is with Visual Studio 2005. I had .Net
3.0 and the newest Windows SDK installed, but just uninstalled them
and it's still a problem.

T

Feb 13 '07 #1
4 3527

"Thos" <th********@gma il.comwrote in message
news:11******** **************@ h3g2000cwc.goog legroups.com...
>I have a TcpListener that gets started from a GUI button event
handler:

TcpListener listener;
listener = new TcpListener(IPA ddress.Any, 1234);
listener.Start( backLog);

As soon as the third line runs, the app freezes, the CPU goes to 100%
on that CPU (Core Duo) and debugging can't break out of it. I can't
even stop the process with the Task Manager but have to reboot to get
it to stop.

Any ideas what's wrong? This is with Visual Studio 2005. I had .Net
3.0 and the newest Windows SDK installed, but just uninstalled them
and it's still a problem.

T

Feb 13 '07 #2

"Thos" <th********@gma il.comwrote in message
news:11******** **************@ h3g2000cwc.goog legroups.com...
>I have a TcpListener that gets started from a GUI button event
handler:

TcpListener listener;
listener = new TcpListener(IPA ddress.Any, 1234);
listener.Start( backLog);

As soon as the third line runs, the app freezes, the CPU goes to 100%
on that CPU (Core Duo) and debugging can't break out of it. I can't
even stop the process with the Task Manager but have to reboot to get
it to stop.

Any ideas what's wrong? This is with Visual Studio 2005. I had .Net
3.0 and the newest Windows SDK installed, but just uninstalled them
and it's still a problem.

T

Feb 13 '07 #3
it seems like a synchronous call ....... your thread is waiting ... thus not
dispatching the UI messages .... either use secondry thread for listening
....... or use asynchronous methods of socket ....
"Thos" <th********@gma il.comwrote in message
news:11******** **************@ h3g2000cwc.goog legroups.com...
>I have a TcpListener that gets started from a GUI button event
handler:

TcpListener listener;
listener = new TcpListener(IPA ddress.Any, 1234);
listener.Start( backLog);

As soon as the third line runs, the app freezes, the CPU goes to 100%
on that CPU (Core Duo) and debugging can't break out of it. I can't
even stop the process with the Task Manager but have to reboot to get
it to stop.

Any ideas what's wrong? This is with Visual Studio 2005. I had .Net
3.0 and the newest Windows SDK installed, but just uninstalled them
and it's still a problem.

T

Feb 13 '07 #4
It runs fine when it is not run in debugging mode, and it also ran
fine in debugging in the past (I think before I installed .Net 3.0).
Any workarounds? I should have to do a tcplistener.sta rt on a
background thread just to make the VS debugger happy.

T

On Feb 13, 3:15 am, "Mubashir Khan" <m...@yahoo.com wrote:
it seems like a synchronous call ....... your thread is waiting ... thus not
dispatching the UI messages .... either use secondry thread for listening
...... or use asynchronous methods of socket ...."Thos" <thos37n...@gma il.comwrote in message

news:11******** **************@ h3g2000cwc.goog legroups.com...
I have a TcpListener that gets started from a GUI button event
handler:
TcpListener listener;
listener = new TcpListener(IPA ddress.Any, 1234);
listener.Start( backLog);
As soon as the third line runs, the app freezes, the CPU goes to 100%
on that CPU (Core Duo) and debugging can't break out of it. I can't
even stop the process with the Task Manager but have to reboot to get
it to stop.
Any ideas what's wrong? This is with Visual Studio 2005. I had .Net
3.0 and the newest Windows SDK installed, but just uninstalled them
and it's still a problem.
T

Mar 17 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1821
by: Doug Wyatt | last post by:
So I'll preface this with the fact that I'm a UNIX developer by training and have just recently gotten in to C# development on Windows. I'm basically running in to a problem whereby I suspect something to do with process groups or threads and closeOnExec semantics (to speak in POSIX terms) is causing me a problem. I've got a windows service (let's call it "myService") that, among other things, does : onStart creates a TcpListener on a...
4
4402
by: Rob White | last post by:
OK, so I have a TcpListener that is waiting for sockets, this piece of code: IPAddress localAddress = Dns.GetHostByName(Dns.GetHostName()).AddressList; IPEndPoint localEP = new IPEndPoint(localAddress, 9000); TcpListener tcpListen = new TcpListener(localEP); tcpListen.Start(); Socket skt = tcpListen.AcceptSocket(); .... do some socket stuff skt.Close();
2
17067
by: Coder | last post by:
hi, i have a simple question; Suppose that followig code is a thread; /***************************************************/ listener = new TcpListener( IP, PORT); listener.Start(); while(running) {
2
4665
by: Dave Coate | last post by:
Hi, I am working on a client-server app. I can get two applications to talk to each other on the same machine using 127.0.0.1, but as soon as I try it using a computer name or actual IP address I get a SocketException: "No connection could be made because the target machine actively refused it". On the server I have a listener: Private m_Listener As TcpListener m_Listener = New TcpListener(IPAddress.Parse("127.0.0.1"), 8000)
2
4062
by: Terry Olsen | last post by:
Hoping someone can help me here. I've got this code written, and it works fine for the first connection. But if I connect another client (while the first is still connected), I get connected but nothing else, no data exchange. If I disconnect the 2nd session, I get a System.IO.IOException. If I disconnect the first session with the 2nd session still connected, then all the data I typed in the 2nd session gets returned to me as if it was...
3
4375
by: Bjørn Eliasen | last post by:
Hi, I have an application running on all pc's in our company. Basically it is a TCPListener awaiting for sockets to connect and on connection performs the required tasks. The app works fine, but while the listener is awaiting for socket to connect several other applications can't start, and even installation of new applications migth hang. In order to finalise the other apps or installations the tcp listener is killed resulting in the other...
2
2737
by: Charlie | last post by:
Hi: I'm creating a simple port listener. When I call start() method it returns "AddressAlreadyInUse" error. He is my code... Int32 port = 80; IPAddress localAddr = IPAddress.Parse( "127.0.0.1" ); TcpListener server = new TcpListener(port); server = new TcpListener( localAddr, port ); server.Start(); // Get error here
0
1130
by: Thos | last post by:
When I debug a standard socket server app that has a tcplistener using VS.NET 2005, the debugger deadlocks (uses 100% of one of my CPUs) when the code runs the tcplistener.Start(). method. I am having the same problem in a sample socket server app that uses socket.Bind(). Both deadlock at this point. Both of them worked normally a week ago on a fresh system (windows xp pro sp2. I have already completely reinstalled my OS to get rid of...
4
3419
by: =?Utf-8?B?Sm9uIEphY29icw==?= | last post by:
(Note: the TCP Client is on another machine, and attempts communication every minute.) Both apps use the same assembly The service app starts thusly, creating the tcp object and starting the timer in the OnStart event. The timer calls OpenServer (one time): Public Class TCPService Private tcp As SimpleTCP Private Timer1 As Timer
0
9736
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9611
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10672
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10408
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10428
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6897
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4359
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 we have to send another system
2
3888
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.