Windows phone: cannot connect to a computer using socket - c#

Situation: there are two programs - client and server.
Server is working on my computer, client program is working on windows phone.
Server is listening for incoming connections ant receive data. Windows phone creates a socket(tcp connection) and sends data.
If I connect win-phone to my computer using USB cable, all works: connection establishes and data is transferring.
But when I create an "infrastructure-network" using the program "connectify", or connect to real wi-fi router (computer and win-phone both are connected to the same network) it is not working. I disabled windows firewall, but it is still not working.
How can it be explained? Where is the problem?

The problem was in ip address string in python server code.
I used "127.0.0.1" instead of "localhost" :(

Related

Client server (service) application connecting locally but not over the network

I have created a windows service server program in c# which will receive data messages from a serial port and then send those messages to any clients that have connected to the server. I have also developed the client program (windows form) in c#.
Originally the server program was developed as a console application to make development easier. While running the server as a console application the connections to the clients worked well, I could run a client on the same PC as the server and also connect a client on a laptop connected to the same network.
The connection method is:
-client starts up
-client broadcasts (udp) to a specific port
-server responds to the UDP broadcast
-client initiates a TCP connection with the server using the IP address obtained from the UDP response
Since changing the server from a console application to a windows service I can no longer connect the client program running on the laptop to the server using this method. The client program running on the same machine as the server connects successfully. Can anyone offer some advice on what to investigate?
To solve the issue I was having I added a new rule in the firewall settings of the machine running the server service application. I allowed the port used on incoming connections and this solved the problem for me.
I also changed the network discovery procedure:
Server broadcasts every second to a port (UDP)
Client awaits the broadcast packet from the server
Client establishes a TCP connection with the server using the IP address obtained from the broadcast packet

How to build TCP connection between two different computers in local network in C#?

I am trying to use C# to develop a client running on a computer and a server running on another computer in local network. I want to let the client connect to the server using TCP socket. When I run client and server on one computer they can be connected but the connection cannot be built when client and server on different server. I guess the problem is the IP address. When I run them on one computer I use localhost as the IP address of both of them. So how can I deal with this problem when they are running on different computers in local network?

Connecting to TCP Server using GPRS Connection

I have Motorola MC75 and I can connect to my Office TCP Server from home using Wi-Fi connection without any problem and send/receive files. But when I use GPRS connection I can not connect to my Office TCP Server.
I have made sure that GPRS is connected to internet(i.e. I can go to explorer and surf the web using GPRS connection(I have turned off wireless at this point)). Can any one help me on this issue. Your help will be appreciated.
Interesting thing is that I have PC at my home and I have static address at home. I can run my TCP Server on my one of the PC at home and I can connect to my home PC from outside using GPRS connection and send and receive data files. But If I try to connect to my Office PC it does not work(My office has static IP address as well). But when I use wireless connection it works fine at my office PC.
I have tried Optus and Vodafone SIM Cards and it did not work.

Remote access pc on usb 3G?

I develop a application remote desktop on c#. it' work good on ADSL with router add NAT port.
but when i run on computer connect internet use usb modem 3g sim because usb modem not use connect like a ADLS (router), application not work. how i can connect pc use usb model? thanks
If your 3G phone service provider puts you behind NAT then you're short of luck as the NAT prevents any incoming connections to reach your computer.
A workaround is to set up a VPN connection from your 3G-connected computer and set up port-forwarding at the VPN server-side, that way your computer can receive new connections, but they would be tunneled.

10013 error (AccessDenied) on Silverlight Socet application

I am writing silverlight 3 application which is working on network.
It works like client-server application. There is WinForm application for server and silverlight application for client.
I use TcpListener on server and connect from client to it with Socket.
In local network it works fine, but when I try to use it from internet it don't connect to server.
I use IP address on local network and real IP with port number for internet version.
I get error 10013 AccessDenied.
Port number is correct and access policy exist.
Firewall is turned of.
Where is the problem?
Thanks.
Have you tried to check the general availability of the connection from your machine to the Internet server with telnet ?
The problem was that computer, where hosted website hasn't real IP address, and I couldn't connect to it from internet. I added Real IP address and everything works fine now.

Categories

Resources