Clients Stop Receiving Data Suddenly

Jan 23, 2009

I am working on a client/server application. Everything seems to go well for a while (a few hrs, a few mins its kind of random) then suddenly clients stop receiving data. maybe 1 or two, or all of them. in the end I end up having to restart the server piece to resolve it, but I am trying to understand why its doing this. I've added try catches around the send piece, but it doesnt error out. When the app fires, the listener is started on its own thread. When a new connection is made, that connection is passed to a class that handles all of my connection data(send/receive, responding to commands, etc). The class is started in its own thread, so each connection is running in its own memory space. This issue seems to happen with 1 client connected, or 20, it doesn't really seem to matter.

This causes other issues, like a customer who thinks he is disconnected, will shut down his app, which is supposed to send a command to close the connection on the server side which it does not., so now I have several "closed" connections still open on the server, which is obviously also bad. Another thing I dont get is that it worked fine when I was developing the pieces on my dev box, so I dont get why I have all of these "timeout" issues now. (I put that in quotes, because the timeout period is the default of 10 mins, and I xmit data, at LEAST every minute when the server pushes data updates to all clients)

Here is some of the relevant code
vb
'Command Object, this holds all of the command information being passed back and forth to tell the server what to do, and as well as hold the response.
'The strCMD is the command, strParms is the parameters of the command, obj is ANY object I want to send along with this information
<Serializable()> Public Structure CommandData
Public strCMD As String
[Code] .....

View 7 Replies


ADVERTISEMENT

How To Stop Application From Receiving A Certain Message

Jan 25, 2012

I believe I have found a solution! I will be continuing testing to make sure it DOES in fact work, but I'm hopeful :) I have detailed how I found the solution in EDIT THREE of the question.

For anyone wishing to know the full background behind my problem and what I have kind of tried as a result of input from this question, see this: [url]

I will be editing this frequently (>3 times a day most weekdays) as I progress my research and situation, so keep checking back if you are interested or have some information or knowledge of my issue :)

Quick Background:

I have this app I have made that can be crashed by changing my screen saver or locking my work station, and in general whenever a WM_WININICHANGE/WM_SETTINGSCHANGE message is sent to it.

If I can consistently crash my app by changing my screensaver, then SOME part of doing that is sending my app SOME kind of message (not necessarily a windows message, I mean message in the most general sense), which in turn is catastrophic to my application. Due to this, I am trying to find a way to block whatever message is causing my problem from being processed by my application. I am aware this isn't the best way to go about a solution, so you don't need to tell me. Look at the backgroung info or ask why if that bothers you (there is a good reason).

View 2 Replies

Stop A Label From Receiving Focus?

Mar 17, 2010

I am working on a data entry type form and I want the enter key to move focus to the next text box. I've got that working great except that the focus is moving to the label that is, in sequence, between the text boxes.

View 14 Replies

C# - WinForms UserControl How Do I Stop The Control Receiving Focus?

Nov 7, 2011

I have a custom UserControl that contains just one TextBox. When I set the control to Enabled = False, the TextBox is disabled but the control is not (control still fires the Enter event).

How do I ensure that the UserControl will not receive focus?My Enabled Property Looks like this:

Private _Enabled As Boolean = True
Public Shadows Property Enabled As Boolean
Get
Return _Enabled
End Get

[Code]...

View 2 Replies

GPIB Communication - Sending Data - Receiving Data - Saving Data

Sep 19, 2010

I need to control a device with a GPIB port. I have the commands that I need to use to do this; but I don't know which is the sintaxis in Visual Basic.

For example if I need to send a instruction like "START:0.01" to the external device which are the libraries that I have to include?, how should I write the programming line to do this?

The main tasks that I need to program are sending data, receiving data, and saving data

View 5 Replies

Sending Data To Clients From A Server In Vb?

Aug 27, 2010

Actually I have created a chat application is it possible to send data to particular client only?

View 1 Replies

TCP Clients Connect - Stream Data Is Lost

Apr 28, 2012

Connection succesfuly made (TCPClients) Writing/Reading with NetworkStream At an interval of 16 ms. Client sends 4 bytes -> Server receives 0 bytes ??? Server Sends 4 bytes -> client receives 0 bytes ???

[Code]...

View 11 Replies

.net - Tcp Client Not Receiving The Entire Data Response Data From Server?

Apr 19, 2011

I have a small program which is a tcp client. I send a string from this client to a device over ethernet (it acts as the tcp server). As soon as the device recieves the input string it will respond back with response data. My problem is i am not getting the entire response data back from the server. (device).

Dim serverStream As NetworkStream = clientSocket2.GetStream()
Dim outStream As Byte() = System.Text.Encoding.ASCII.GetBytes("my-cmd")
serverStream.Write(outStream, 0, outStream.Length)

[code]....

View 4 Replies

Create A Server That Can Read Data Sent By Multiply Clients?

May 19, 2010

Basicly I want to create a server that can read data sent by multiply clients and give feedback to them I have found some tutorials before but its only oneway trafic (Client>>>>Server) and the server crashes as soon as the client is disconnected

ps. If its a tutorial with VB it will be nice other visual codes are also good

View 6 Replies

VS 2008 Multiple TCP Clients - Send The Data Twice To The Same Client

Mar 18, 2009

I have a large class that I built to act as a TCP server for one of my silverlight applications. When a user connects it stores the tcp client into a table for later communication. The problem is that when I send data, with more than one client connected, it loops through both open TCP Clients but some how sends the data twice to the same client.... the other tcp client never receives his data. This isn't a logic issue as I can step through the code and see that it is clearly taking each individual TCP client out of the table and sending it the data. They all use the same port... could that be the issue? And if so how do I make it so that it can connect on one port then transfer to another? I have tried using different computers for connecting but still the most recently connected client receives all of the packets of data.

View 6 Replies

Receiving Data From USB?

Mar 23, 2007

Actually my project is based on rfid. The transmitter sends data to the remote reciever that is attached to the pc through USB. Now i have to design a VB.net interface for the recieved data.I dont know how to program and get data from USB and utilize it. I only have to receive the data and not to send.

View 14 Replies

TCP Receiving / Sending Data

Nov 11, 2009

Im woundering how does Receiving/Sending data work in a TCPClient/Server that is connected in the same networkstream.

View 4 Replies

Data Receiving With Socket?

Sep 27, 2011

i am working on 3rd party chat software, when ever i send data to server i get incorrect buffersize of data. like when i convert that data to hex to matching header for splitting data i got huge lengths data

in the above textbox of image i have got some 0000000000000000000.... with the hex data, how can i get only only original data. The code i have used to receive data is

[Code]...

View 1 Replies

Sending And Receiving Data To Or From PIC Through RS-232?

Nov 14, 2011

Currently I had write a simple VB code, my aim is when i click "Forward" button then the vb will send a character "A" to PIC, "Reverse" button will send "B" so I write my vb code for sending as below:

Dim Forward As Char = "A"

SerialPort1.Open()

SerialPort1.Write(Forward)

For the receiving part, after I received the data from PIC then I will show it at the label which act it as a screen. the receiving code as below:

SerialPort1.Open()
receive = SerialPort1.ReadChar()
If receive = "A" Then[code]....

View 14 Replies

Sending And Receiving Data Via USB?

Dec 4, 2011

I am working on system support for an electronics project wherein I have to receive an 8 bit (binary) data through a USB port and store either the binary or the corresponding decimal into a variable. How can I implement this in visual basic 2010?

View 11 Replies

TCP Client Receiving Data?

Dec 6, 2009

I have made this code:

Dim tcpClient As New System.Net.Sockets.TcpClient()
tcpClient.Connect("usuarios.lycos.es", 80)

[Code]...

View 4 Replies

.net - Passing And Receiving Data Between A Php And .exe Application?

Apr 24, 2012

there is a complex situation wherein, I have to pass a string data to a .exe application and this .exe application would process the string and respond back to my php data. I prefer not to use a TCP/IP connection.

View 1 Replies

Communications :: Receiving RS-232 Corrupted Data?

Jan 8, 2009

I got a CRC checksum now and I get a Message in this Format SOH, Length Of Incoming Message, Message, CRC Checksum So I have a nice little look to processes the message and everything, Now I have questions on two events, While this loop is running it awaits for Data on the wire to come through and Checks for the SOH, I always get that but what are the chances of NOT getting a SOH, and if I don't what should I do with the Buffer Dump everything Till I come to another SOH? And on another scenario If two Packets are clashed together in one buffer should I always try to Peek and see if the Next byte after the CRC is a SOH to see if there is more Bytes and an whole another command to start Parsing and then take action?

View 4 Replies

Not Receiving All Data With Networkstream.read

Dec 11, 2011

I'm using the following code to get newsgroups from a server[code]...

When I execute the code, the routine only receives one block of the data. However, if I go into debug mode with a breakpoint at the loop instruction, I receive all of the blocks of data.Am I missing something in the code, like a wait or something, that would allow the program to receive all data like happens with the debug?

View 1 Replies

Not Receiving All Data With Networkstream.read?

Dec 8, 2011

I'm using the following code to get newsgroups from a server:
sendBytes = Encoding.ASCII.GetBytes("LIST active microsoft.public*" & ControlChars.CrLf)
networkStream.Write(sendBytes, 0, sendBytes.Length)

[code].....

View 2 Replies

Receiving Data From Serial Port?

Nov 30, 2008

i was not getting o/p properly when i tried to receive data from serial port using the following code.

Public Class form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If SerialPort1.IsOpen Then

[code]....

View 4 Replies

Receiving Data With MScomm From Modem?

Jul 1, 2009

I am making aproject in vb6 with MScomm. Computer A connected with a device on serial port. I can receive the data from serial port in a text box. Computer A can also dial cmputer B to make connection. But it is unable to send data on modem or computer B is unable to receive data from modem.Here is the code for sending and receiving computers1- Computer A

Option Explicit
'button to open data port to receive from device
Private Sub cmdOpen_Click()

[code].....

View 3 Replies

Receiving Wrong Serial Data?

Dec 13, 2009

I have a program that receives serial data from a microcontroller and displays it.If I use windows terminal I get the right data.For some reason my program is not displaying the right data.What is sent is temperature.So the actual data is 24 degreesC and my program is showing 10 degreesC.

Private
Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived

[code]....

View 8 Replies

Increase Speed Of Receiving Data Through GPRS

May 13, 2010

How to increase speed of receiving data through GPRS? We connect through UDP Protocol and sync method for receiving DATA. Can you suggest me to best way to communicate with GPRS? [Code]

View 3 Replies

RS232 - Sending And Receiving Bit Data To The Machine ?

Jun 11, 2011

Does anyone knows how to program using vb.net with rs232 module?, all i know is that i should use a compolet, but i can't understand a thing regarding the sending and receiving bit data to the machine..

View 1 Replies

Sending / Receiving Data To Serial Port

Aug 13, 2009

I'm trying to control a serial port device that both send and receives data. I can receive data quite happily from the serial port but I don't appear to be able to send data to the device. The device works perfectly as I can test it using putty, I open putty select serial and select 1200 baud, the device immediately lights up and can send and receive. However when the port is set up and opened in VB the device doesn't light up so I can't send data to it but can receive data from it. According to the instructions I need to send either ASCII 'X' Hex '$58' or Decimal '88' to make the device ready.

Code (VB Studio 2005) :-
Public Sub New(ByVal synchronisingObject As ISynchronizeInvoke)
ComPortUsed = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINESoftwareNJB", "COMUSED", Nothing)
PricePerTrack = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINESoftwareNJB", "PRICETRACK", Nothing)
Me.synchronisingObject = synchronisingObject
[Code] .....

View 11 Replies

Sending And Receiving Data To RS232/MSComm A VB6.0 App?

Sep 14, 2009

I am developing an application which is pretty much a replacement of a hyperterminal. I am trying to send commands to the serial port using MSComm in VB6.0 When I type in on the hyperterminal h003128 I get a response OK. Or when I type in i003 it displays back some values.

What I am trying to figure out how do I send the h003128 via VB6. I believe I've undertood how to send data to the port. It seems I am not getting the correct formate. This wont work.. the formate iAAADDD where i = i AAA = 003 and DDD = 128 MSComm1.Output "i003128"

View 3 Replies

Sending/receiving Serial Port Data?

Feb 22, 2011

Opening and closing the port works fine, and as far as i can tell, the serial.write("blahblah") should be writing to the output buffer, but I am unable to test or verify this by reading it in. the commented "Receive data from serial port" and subsequent DoUpdate() function are where i am having trouble. It doesnt seem to actually be reading in the data if it is in fact writing it correctly.

[Code]...

View 9 Replies

VS 2008 Sending And Receiving Data Via Com Port?

Aug 16, 2010

I have a very basic knowledge of coding, just enough to understand some PicBASIC Pro and program a microchip to send the values of some variables to a PC via the com port. I've used a terminal utility like Hyperterm to confirm the right variables are being sent, so I thought it would be cool to have a custom application on the PC to display these variables, and possible set them via the application by writing the new one back to the PIC. So I downloaded VB express 2008 - and whilst it was "simple" to draw a box and add a few text boxes I'm lost at how to actually do anything practical with it

[Code]...

Could someone advise me in laymens terms exactly what I need to do inorder to populate the text boxes with the data from the PIC micro. Whilst I understand the basics about BASIC, I have no idea on things like classes etc

View 5 Replies

Check When Serial Port Has Stopped Receiving Data?

Dec 20, 2009

What I am doing is creating an app to send and receive CNC programs to machine tools via the RS232 interface. At the moment I am testing the software with 2 laptops linked together through a cable I have made up. which all works. I have added a serial port to my form 1 and using the code below I can send and receive data. However with the send button I can open the comm port send the data and then close the comm port (No Problems there). With the receive button I want to open the comm port receive the data and close the comm port. The problem I have is checking when the app has finished receiving data so I can then close the comm port

Private Sub Btn_Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Send.Click
Try

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved