473,414 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Parametrized Threads in Windows Server 2003 R2

4
Hi all, I've been working on an .net application which starts different instances of a class, each one contains a main thread (it's a TcpListener). The application so far in the development PC (WinXP SP3 Pro, VS2008, .net Framework 3.5 SP1) works very nice, but when i move it to the destination machine (Windows Server 2003 R2, .net Framework 3.5 SP1) it just doesn´t works. I've tracked the error to the main thread in each one of the instances, and is caused because i read the Parameters passed to the thread itself! Someone has an idea about what could i've been missing? Thanks in advance.

Thread initialization:
Expand|Select|Wrap|Line Numbers
  1. ListeningThread = new Thread(new ParameterizedThreadStart(ServerThread));
  2. ListeningThread.Name = "ListeningThread";
  3. ListeningThread.IsBackground = true;
  4. ThreadList.Add(ListeningThread);
  5.  
  6. myLog.Add("Thread de servidor lanzado");
  7.  
  8. string Data = ListeningIP.ToString() + ":" + Port.ToString();
  9. ListeningThread.Start((object)Data);
  10.  
Thread itself
Expand|Select|Wrap|Line Numbers
  1. public void ServerThread(object EndPoint) //EndPoint = IP:Puerto (en string)
  2. {
  3. // Crea un socket TCP/IP (IPv4) y escucha por conexiones.
  4. try
  5. {
  6.     string Parametros = (string)EndPoint;
  7.     myLog.Add("--ThID:{" + Thread.CurrentThread.ManagedThreadId.ToString() + "}Datos recibidos en el thread: " + (string)EndPoint);
  8.  
  9.     string[] Datos = Parametros.Split(':');
  10.     if (Datos.Length < 2)
  11.        throw new Exception("Error en parametros");
  12.     System.Net.IPAddress LocalIP = System.Net.IPAddress.Parse(Datos[0]);
  13.     int LocalPort = Int32.Parse(Datos[1]);
  14.     myLog.Add("--ThID:{" + Thread.CurrentThread.ManagedThreadId.ToString() +  "}--Entrando a Thread de Servidor--");
  15.     myLog.Add("--ThID:{" + Thread.CurrentThread.ManagedThreadId.ToString() + "}--IP para escuchar: " + LocalIP.ToString() + ":" + LocalPort.ToString());               
  16.  
  17.  
  18.     TcpListener listener = new TcpListener(LocalIP, LocalPort);
  19.     myLog.Add("--ThID:{" + Thread.CurrentThread.ManagedThreadId.ToString() + "} Datos Listener" + listener.LocalEndpoint.ToString());                  
  20.     listener.Start();
  21. .....
  22.  
Jun 3 '10 #1
3 1933
Plater
7,872 Expert 4TB
What is the exact error message you get?
Is it possible its a priveledge issue?(You are moving from a non-server to a server OS so things might be different with the priveledges)
Jun 4 '10 #2
JSan
4
Well, i´m logging in as Administrator, and the problem is very weird, te first times tha app just ended with no messagebox or error logged, but i noticed that DW20.exe (Doctro Watson for Office)started just before the application crashed so i rename DW20.exe. Now i can see a Message Window but the message doesn't display any useful info, just says: "Tha application XXXX encountered a problem... ThreadID(0x23CC)" so i don't have any more info. Thanks
Jun 4 '10 #3
Plater
7,872 Expert 4TB
That sounds like an unmanaged exception.
UNLESS there was a "details" or "see what this report contains" type link/button(could be a text link like on a webpage would be or maybe a regular button). Sometimes in there it will tell you the managed exception that is coming up.
Jun 4 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Christopher W. Douglas | last post by:
I have an MSDN subscription, and have all versions of Windows Server 2003 available. I have been programming in Visual Studio .NET 2002 in Windows XP and 2000, and I am setting up a new machine...
0
by: kdt | last post by:
Please help I have a spare Pentium III that I want to install the Windows Server 2003. I have checked the list of Windows Server 2003 system requirements against the machine that I have. It...
0
by: sztonix | last post by:
Hi all, I encountered a crystal report deployment problem. I make reports with Crystal Report for Visual Studio .NET 2003. It works fine in the development machine. And then make setup...
2
by: heyitsme_ryan | last post by:
Ei guys I’m Ryan from Philippines, I need your advice and recommendations about Windows 2003 Server and SQL Server 2000 installation. Well, here’s the scenario. First is for windows 2003 server:...
5
by: Larry Bertolini | last post by:
Scenario: DBMS: SQL Server 2000 OS: Windows Server 2003 Goal: Enable SQLMAIL via Internet Mail Problem: How do I set up the MAPI profile for the SQL Server service account?
9
by: Kevin Spencer | last post by:
We just moved an ASP.Net app to a Windows 2003 Server, and the SMTPMail fails now with the following message: System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,...
4
by: Matthew Louden | last post by:
My ASP.NET application is working fine when I run under IIS Personal Web Server in Windows 2000 machine. However, after I upload all the files to the Windows Server 2003 machine, and tried to run...
0
by: Matthew Louden | last post by:
The web server is running Windows Server 2003 Standard Edition, and it returns HTTP 404 error when running ASP.NET pages, but ASP pages are working fine. I also installed Visual Studio .NET, and...
10
by: Ger | last post by:
I am having problems using VB.Net's Management base object on a machine hosting Windows Server 2003. I am trying to set file permissions from a Windows Service. These files may be loacted on a...
0
by: Charles Leonard | last post by:
I am having yet another issue with Windows Server 2003. This time, the web service (a file import web service) appears to run except for one odd message: "ActiveX component can't create object". ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.