473,387 Members | 1,553 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,387 software developers and data experts.

TCP Connection Problem /w Pocket PC Emulator

Hi everyone!

I am experiencing a problem when trying to establish a TCP connection
between a

program running locally and another program running on the Pocket PC
emulator

provided by the .NET 2003 environment.

TCP listener:

try {
TcpListener listener;
listener = new TcpListener(IPAddress.Any, 8000);
listener.Start();

while (true)
{
Socket connection = listener.AcceptSocket();
...
} } catch (Exception ...) {...}

TCP client:

TcpClient client;
try
{
client = new TcpClient("localhost", 8000);
...
} catch (...) {...}

I started the first program (with the TCP listener), and then started
the second

one in the .NET IDE with the pocket PC emulator as the target for
deployment. Then

an exception was caught:

"No connection could be made because the target machine actively
refused it."

Can any one tell me how to fix this problem? Many thanks!

Nov 16 '05 #1
3 6901
bh
TcpClient - sample:
http://msdn.microsoft.com/library/de...ClassTopic.asp

TcpListener - sample:
http://msdn.microsoft.com/library/de...classtopic.asp

"minying" <ml***@doc.ic.ac-dot-uk.no-spam.invalid> wrote in message
news:41********@Usenet.com...
Hi everyone!

I am experiencing a problem when trying to establish a TCP connection
between a

program running locally and another program running on the Pocket PC
emulator

provided by the .NET 2003 environment.

TCP listener:

try {
TcpListener listener;
listener = new TcpListener(IPAddress.Any, 8000);
listener.Start();

while (true)
{
Socket connection = listener.AcceptSocket();
...
} } catch (Exception ...) {...}

TCP client:

TcpClient client;
try
{
client = new TcpClient("localhost", 8000);
...
} catch (...) {...}

I started the first program (with the TCP listener), and then started
the second

one in the .NET IDE with the pocket PC emulator as the target for
deployment. Then

an exception was caught:

"No connection could be made because the target machine actively
refused it."

Can any one tell me how to fix this problem? Many thanks!

Nov 16 '05 #2

"minying" <ml***@doc.ic.ac-dot-uk.no-spam.invalid> wrote in message
news:41********@Usenet.com...
TCP client:

TcpClient client;
try
{
client = new TcpClient("localhost", 8000);
...
} catch (...) {...}

"No connection could be made because the target machine actively
refused it."

Can any one tell me how to fix this problem? Many thanks!


Normally, you do not need to specify the address of the client socket . The
cases where you would need to specify the address and port for the client
socket might involve a multi-homed host when connecting to another host and
that host only accepts connections from specific IP addresses or from
specific ports.. Blocked ranges of ports using firewalls may be another
case.

The WinSock implementation will construct the socket and bind it to an
available local address and port if you attempt to conect using an unbound
socket. However, to specify the IP address for the TcpClient object, try
something like this:

TcpClient clSock;
IPAddress iaddr = IPAddress.Parse("121.9.9.109");
IPEndPoint endp = new IPEndPoint(iaddr, 8000);
clSock = new TcpClient(endp);

or this:

TcpClient clSock;
IPAddress iaddr = Dns.Resolve("localhost").AddressList[0];
IPEndPoint endp = new IPEndPoint(iaddr, 8000);
clSock = new TcpClient(endp);

Use this if you are OK with the system assigned values for the client :

TcpClient clSock;
clSock = new TcpClient();

regards
roy fine
Nov 16 '05 #3
Hi,

just wanted to know if you were able to solve the problem?

i am facing the same problem and cant seem to get it fixed ?

do i keep the connection in the emulator as DMA or TCP?

thanks.
Feb 9 '06 #4

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

Similar topics

1
by: Paul | last post by:
I have put together two small (testing) applications, one using the full blown .net framework(for win32) and the other using the compact framework(for pocket pc). The applications are identical...
1
by: juan5 | last post by:
Hi I purchased an h5500 series HP pocket pc. Using VS.NET 2003 I am able to build and deploy to the Pocket PC 2002 Emulator but not to debug the app The app is "installed" in the emulator just...
0
by: Minying via .NET 247 | last post by:
Hi everyone! I am experiencing a problem when trying to establish a TCP connection between a program running locally and another program running on the Pocket PC emulator provided by the .NET 2003...
2
by: Claire | last post by:
Running visual studio .net 2003, Ive created a project for a pocket pc. I want to run it in my pocket pc 2003 emulator because if I use that particular one I can connect the emulator to activesync...
0
by: summer00 | last post by:
HI, This xml http://www.pocketpcthoughts.com/xml/ display perfect in IE6 , XML is generally supported in pocket IE if im not mistaken , but when i try to view this in the pocket pc 2003...
0
by: Clare Howard | last post by:
Hi, We are working on a project that requires that we implement MSMQ on the Pocket PC. As from online documentation it seems that MSMQ is only supported with Compact Framework 2, I have been...
1
by: Serge Boivin | last post by:
Hi I need to make a application to communication with other devices by TCP connection, i can go on internet with EMULATOR, but when i try my program, i can't connect to my devices, i trying to...
1
by: amit.amitkohli | last post by:
Hello, Am developing a web app (.Net 2.0) that can be accessed from a Pocket PC device. For testing the app, fired up the emulator from device manager (in VS2005), but when I try to use Pocket...
2
by: Mihai Popescu | last post by:
I wrote a simple application in MFC that uses MSComm ActiveX Control for serial communication. This app works just fine but I have to port it to Pocket PC. So, I wrote another simple application in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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
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
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
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,...

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.