hi all,
I have written a C# Service which is a Server accepting Clients,It is
working fine when i connect from localhost but when i connect from any other
machine to my machine , the service is not working, the Service is in
"Network Service".....i even tried "Local System" and also "Local Service"
but the end result is , it is working only for Localhost connections and not
for Remote Connections...
the code for server is as follows..
////////////************Server Code starts here**********//////////////////
IPAddress ipAddress = Dns.Resolve("localhost").AddressList[0];
TcpListener listener = new TcpListener(ipAddress,portNum);
try
{
listener.Start();
TcpClient handler = listener.AcceptTcpClient();
////extra things done here
}
////////////************Server Code starts here**********//////////////////
but the remote connections are not getting connected.......why so?
with regards,
C.C.Chakkaradeep 6 1930
"Chakkaradeep" <Ch**********@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com... hi all,
I have written a C# Service which is a Server accepting Clients,It is working fine when i connect from localhost but when i connect from any other machine to my machine , the service is not working, the Service is in "Network Service".....i even tried "Local System" and also "Local Service" but the end result is , it is working only for Localhost connections and not for Remote Connections...
the code for server is as follows..
////////////************Server Code starts here**********////////////////// IPAddress ipAddress = Dns.Resolve("localhost").AddressList[0]; TcpListener listener = new TcpListener(ipAddress,portNum); try { listener.Start(); TcpClient handler = listener.AcceptTcpClient(); ////extra things done here } ////////////************Server Code starts here**********//////////////////
but the remote connections are not getting connected.......why so?
How would you like your clients to connect if you bind your listener to
'localhost' which resolves to 127.0.0.1?
You have to use your real host name, not the loopback address.
Willy.
hi willy,
this was really a silly but a BIG mistake........thanks for the reply....
with regards,
C.C.Chakkaradeep
"Willy Denoyette [MVP]" wrote:
"Chakkaradeep" <Ch**********@discussions.microsoft.com> wrote in message news:06**********************************@microsof t.com... hi all,
I have written a C# Service which is a Server accepting Clients,It is working fine when i connect from localhost but when i connect from any other machine to my machine , the service is not working, the Service is in "Network Service".....i even tried "Local System" and also "Local Service" but the end result is , it is working only for Localhost connections and not for Remote Connections...
the code for server is as follows..
////////////************Server Code starts here**********////////////////// IPAddress ipAddress = Dns.Resolve("localhost").AddressList[0]; TcpListener listener = new TcpListener(ipAddress,portNum); try { listener.Start(); TcpClient handler = listener.AcceptTcpClient(); ////extra things done here } ////////////************Server Code starts here**********//////////////////
but the remote connections are not getting connected.......why so?
How would you like your clients to connect if you bind your listener to 'localhost' which resolves to 127.0.0.1? You have to use your real host name, not the loopback address.
Willy.
hi,
my service is working fine..if i connect from the same machine to my server
which is also running in the same machine, there s no any delay but the same
if i connect to my service from anyother remote client, there s delay,it is
taking minimum 60 seconds.....is this my network problem r is that i have
fine tune somewhere n my Server....
with regards,
C.C.Chakkaradeep
"Chakkaradeep" wrote: hi willy,
this was really a silly but a BIG mistake........thanks for the reply....
with regards, C.C.Chakkaradeep
"Willy Denoyette [MVP]" wrote:
"Chakkaradeep" <Ch**********@discussions.microsoft.com> wrote in message news:06**********************************@microsof t.com... hi all,
I have written a C# Service which is a Server accepting Clients,It is working fine when i connect from localhost but when i connect from any other machine to my machine , the service is not working, the Service is in "Network Service".....i even tried "Local System" and also "Local Service" but the end result is , it is working only for Localhost connections and not for Remote Connections...
the code for server is as follows..
////////////************Server Code starts here**********////////////////// IPAddress ipAddress = Dns.Resolve("localhost").AddressList[0]; TcpListener listener = new TcpListener(ipAddress,portNum); try { listener.Start(); TcpClient handler = listener.AcceptTcpClient(); ////extra things done here } ////////////************Server Code starts here**********//////////////////
but the remote connections are not getting connected.......why so?
How would you like your clients to connect if you bind your listener to 'localhost' which resolves to 127.0.0.1? You have to use your real host name, not the loopback address.
Willy.
"Chakkaradeep" <Ch**********@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com... hi,
my service is working fine..if i connect from the same machine to my server which is also running in the same machine, there s no any delay but the same if i connect to my service from anyother remote client, there s delay,it is taking minimum 60 seconds.....is this my network problem r is that i have fine tune somewhere n my Server....
with regards, C.C.Chakkaradeep
I wouldn't know, but I guess it's more likely a bug than a network problem.
I would try to telnet with your service (telnet servername port), to see
wheter it's a server or a client issue.
Willy.
Hi Willy,
i tried connecting by writing a Client program in Linux and connecting to my
server...within no time the Client connected..!!!!...but wht abt c#
Client??...is this s C# Client program??....i used TCPClient for writing
Client program...
with regards,
C.C.Chakkaradeep
"Willy Denoyette [MVP]" wrote:
"Chakkaradeep" <Ch**********@discussions.microsoft.com> wrote in message news:49**********************************@microsof t.com... hi,
my service is working fine..if i connect from the same machine to my server which is also running in the same machine, there s no any delay but the same if i connect to my service from anyother remote client, there s delay,it is taking minimum 60 seconds.....is this my network problem r is that i have fine tune somewhere n my Server....
with regards, C.C.Chakkaradeep
I wouldn't know, but I guess it's more likely a bug than a network problem. I would try to telnet with your service (telnet servername port), to see wheter it's a server or a client issue.
Willy.
"Chakkaradeep" <Ch**********@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com... Hi Willy,
i tried connecting by writing a Client program in Linux and connecting to my server...within no time the Client connected..!!!!...but wht abt c# Client??...is this s C# Client program??....i used TCPClient for writing Client program...
There must be something wrong in your C# client, step through it in the
debugger and look where it waits.
Willy. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: mailme.faisal |
last post by:
I have created a service that create a process.
The service is running in local system account & it also create the
new process in system account.
In process i have to access network resource ....
|
by: Belsam |
last post by:
Hi all
I need to create a windows service that will wait for a file to be
copied somewhere, write it to the database, and then move the file to
a storage area.
I don't know when the file will...
|
by: Rob |
last post by:
Hi,
I am working on a project that requires a Windows Service which
performs the following file transfer functions.
1. It monitors a specific local directory on a Windows 2003 Server.
2. When...
|
by: Mark Rae |
last post by:
Hi,
I'm looking for advice concerning what to do if a Windows service does not
find a "viable" working environment at startup.
E.g. I have a Windows service which does the following:
1)...
|
by: Martin |
last post by:
Hi,
Transferred a working ASP.Net app and database to a new machine and domain.
The app should be running as the local aspnet account (<processModel
userName="machine" password="AutoGenerate"...
|
by: Kevin D. |
last post by:
Please note, I already posted this on the MySQL official forum, but received
no response. I thought I'd try again in another location. My apologies to
anyone reading this twice...
Despite...
|
by: Mike |
last post by:
Can a vb program running as a serice not use network paths to do file/io?
I can't seem to get my program to work with network paths and files. When I
use local disk it works fine. When I run it...
|
by: cj2 |
last post by:
This code works:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using...
|
by: |
last post by:
Hi all,
I have an asp.net 2.0 website that accesses a locally hosted web service.
This works fine on servers that are connected to our network. However, I am
having a problem with a laptop...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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...
| |