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

Socket connection lost (Connected = false)

Hi all,
i try to write a website which should dynamically show
statusinformation of the user which are using it.
Another server provides the information over TCP (plain text api).

In the codebehind file i create a thread which connects to the server
and store it as a session variable...
The first time it works, after the function fails (recieve timeout)
the property connected is false ...

Does somebody have an idea ?
I need to recieve events from that server and then i need to reload
the page...
Does somebody have an idea ?

Kind regards
Christian

Sep 26 '07 #1
3 3533
When the page is returned to the browser, the Page class is released from
memory, but not the Thread. Rather than using this method, I would suggest
that you create a Web Service that maintains a constant connection to the
server, and can provide the information to the various instances of the Page
by request.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Christian" <ch****************@web.dewrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
Hi all,
i try to write a website which should dynamically show
statusinformation of the user which are using it.
Another server provides the information over TCP (plain text api).

In the codebehind file i create a thread which connects to the server
and store it as a session variable...
The first time it works, after the function fails (recieve timeout)
the property connected is false ...

Does somebody have an idea ?
I need to recieve events from that server and then i need to reload
the page...
Does somebody have an idea ?

Kind regards
Christian

Sep 26 '07 #2
Hi Kevin,
thanks for your help... I figured out, that this only happens if the
socket.recieve returns on timeout ...

I already thaougt on catching the data external ...

How can i communicate with the webservice ?
Is there a "simple" way ?
What advantages has a websevice ?

Kind regards
Christian
Sep 26 '07 #3
Hi Christian,

XML Web Services are contacted via HTTP, using SOAP (Simple Object Access
Protocol). You can read more about Web Services here:

http://msdn2.microsoft.com/en-us/library/ms996507.aspx

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Christian" <ch****************@web.dewrote in message
news:11**********************@22g2000hsm.googlegro ups.com...
Hi Kevin,
thanks for your help... I figured out, that this only happens if the
socket.recieve returns on timeout ...

I already thaougt on catching the data external ...

How can i communicate with the webservice ?
Is there a "simple" way ?
What advantages has a websevice ?

Kind regards
Christian


Sep 27 '07 #4

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

Similar topics

8
by: Wally | last post by:
Hallo Is there anybody able to tell me if and how to restore a lost socket communication? I try to explain. Computer A and computer B are net connected and they estabilished a socket connection....
4
by: DreJoh | last post by:
I've read many articles on the subject and the majority of them give the same solution that's in article 821625 on the MSDN website. I'm using the following code and when a the client disconnects...
5
by: Morten | last post by:
How do I detect if a client socket is no longer connected to the listen tcp socket ? I have tried with (just an example): --------------------- Socket tcpSocket; ...
2
by: Droopy | last post by:
Hi, I try to implement a reusable socket class to send and receive data. It seems to work but I have 2 problems : 1) I rely on Socket.Available to detect that the connection is closed (no...
5
by: zxo102 | last post by:
Hi, I am doing a small project using socket server and thread in python. This is first time for me to use socket and thread things. Here is my case. I have 20 socket clients. Each client send a...
7
by: semedao | last post by:
Hi all, I view many posts about this issue , the connected property does not tell us the current status of the socket. based on couple of suggestions of msdn , and some article here , I try to...
3
by: Court Jester | last post by:
Hi all, Excuse me if this is wrong forum for this but I've implemented a protocol handler for my socket server using the state pattern and it works fine until I attempt to introduce heartbeats...
2
by: darthghandi | last post by:
I am trying to pass a socket object when an event is signaled. I have successfully bound to a network interface and listened on a port for incoming connection. I have also been able to accept...
11
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...

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.