Dont Get Any Data From Socket When Data Should Be There And No Exeptions Raised, Connection Is Open. Using DataAvailable To Wait For Data

Mar 24, 2011

I have a problem reading data from an RFID-reader. I connect to the reader by tcp and wait for DataAvailable to be true, then reading the data until I got a end of data character. Then I just go back and waiting for a new DataAvailable. This is done in a own thread for the function.

There seems to be some kind of timeout, If I don't got any data in a couple of minutes, then it just sits there in the do/loop waiting for DataAvailable. I hold the card to the RFID reader, it beeps, but there is no data available. I don't get any exeptions, and the information says that the clientsocket is still connected. Are there anything more I can check?

If I put the card to the reader in a minute-interval it seems as this will never occur. So 2-3 minutes idle:ing seems to do this.

Here are my code to read data from the socket, I have taken away some irrelevant code:

Sub test(ByVal ip As String, ByVal port As Integer)
' this sub is meant to run forever

[CODE]......................

View 1 Replies


ADVERTISEMENT

Receive Data From Multicast LAN IP With Socket Connection?

Mar 24, 2012

I converted some codes from python to VB 2010. My aim is sending query data to multicast IP and get the response. My query data receiving from device which is connected to my LAN. Also the device responding my query and my PC receiving the responce but at this point the VB program freezing.getting response data and printing to console without freezing.

This is the code list;

Imports System.Net
Imports System.Net.Sockets
Imports System.Text

[code]....

Here is the Wire Shark (Network Protocol Anlyzer) screen shots; My computer IP is : 192.168.0.11 and device's IP is : 192.168.0.10.

View 2 Replies

VS 2008 Socket Connection For Realtime Data?

Feb 28, 2011

i need a little advice/help here. There is a particular scenario that is coming up and I am clueless as to how to go about it."I will soon have a lease line through which I will get realtime stock market data. This data will be available every second and it will contain prices of stocks. Now assume I am able to get that data on my local computer. How can I transmit data so that users can get that data through my software.

For e.g. assume it's 11 AM. Now if you select a stock e.g. Google, then my program should fetch data for google till 11 AM and also show new data every second or so with minimum lag. Something like a terminal where you see stock prices getting updates every second. In my case I need to get past data and show current data which get updated at short intervals."

Now I have a linux vps webserver which hosts my site. (I get one or two static ip free) What to do so that data goes from my local computer to my server and then my program (developed in vb.net) is able to get it and show it to end user. This whole system should such that its fast (real-time) and delay is minimum.

View 6 Replies

Reading Data From A Socket (as Bytes) And Storing Data In A String?

Nov 29, 2009

I am reading data from a socket (as bytes) and storing this data in a string. Then later i need to access specific bytes within the string and do some math with them. However the bytes that I read back from the string are not what I am expecting.

[Code]...

View 2 Replies

Asp.net - .NET Framework Data Provider For Oracle Multiple Open Connection

Jan 17, 2012

I have the below mentioned code in a seperate class file for establishing connection and carry out DB transactions. I have an issue where multiple connections being opened which sometime exceed the connection pool. When I stepped through the code I found that there are codes which call ConnectDB() in a loop without calling DisconnectDB(). But I expected that the condition OraConn.State = ConnectionState.Closed should handle the situation. Somehow the condition is always satisfied hence openning another set of connection. Can you suggest where am I going wrong and also what best practice can be adopted here?

[Code]...

The connection is again opened in function updData(). While I understand that it has to be closed correctly but keeping tab on every developer is not possible. Hence I want to control it directly from the connection class by using the same connection but the condition If OraConn.State = ConnectionState.

UPDATE I have put the code in UpdateDB under a Using block and removed call to ConnectDB and DisconnectDB from function like InsertData(...). It seems that the issue has been resolved. But I would like to know in case of exception will the connection remain open? and also OraConn is a public variable defined outside Using block so will it be disposed of by the GC?

[Code]...

View 1 Replies

DB/Reporting :: Cannot Find In The Data Toolbox The Connection And Data Adapters

Sep 27, 2009

I recently switched to V.Studio 2008 and using VB. I can not find in the data toolbox the connection and data adapters. Should I do something else to make this appear so I can drag them in my form.

View 2 Replies

VS 2008 - Have To Open And Close The Connection And The Data Reader While Access The Database?

Apr 21, 2009

When using SQL connections in my program, will I have to open and close the connection and the data reader each time I want to access the database ?

[code]...

View 1 Replies

Copy Opened Database - Application Gets It's Data From A Mdb-file And The Connection Remains Open As Long A Person Works?

May 14, 2010

The fact is I'm making an application, which users can install by using a Setup file...once installed the data in the database can be updated by a centralized server. To do this, they can insert a DVD/CD-ROM and export the necessary data towards it. I need to do it that way, because some of the users who really need this data will be using stand alone computers.The application gets it's data from a mdb-file and the connection remains open as long a person works with the application (maybe not the best way to do, but I know :-) )...when the user uses the application, he can perform an export...this exports the .ini-file and pictures (which works fine), but he also needs to export the mdb behind the application...I already tried connection.close() before and connection.open() after the System.IO.File.Copy...but that doesn't seems to work.

View 2 Replies

VS 2008 - Choose Data Source - User To Easily Create A Connection To Any Installed Data Types They Have Installed

Jun 1, 2011

I have been trying for days now how to create a process to the user to easily create a connection to any installed data types they have installed. I have found an example right inside vb2008. I never use this because I code my own connections, but this would be real nice if I could include it or duplicate it.

View 1 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

Send Data With Socket?

Feb 21, 2011

I want to connect with a barcode printer and sendhim some specific characters and take back anything they send to me

[code]...

View 2 Replies

BitConverter - Sending Data Across TCP Socket

Apr 9, 2010

Given the following information
Public Enum Request As Byte
None = 0
Identity = 1
License = 2
End Enum
Protected mType As Communication.Request
mType = Communication.Request.Identity
Debug.Print (BitConverter.GetBytes(mType).Length.tostring)
2

Why does bitconverter report that mType is a length of 2. I would have thought that passing a Byte into BitConverter.GetBytes would just return the Byte. I mean it's no big deal because it's only sending a very small block of data across a TCP Socket, but I'm just intrigued why it thinks it's 2 bytes.

View 1 Replies

C# - Read A XML Data From TCP Port Socket

Jun 2, 2010

I have a device which send me data over a particular port. The data is in XML Format.

Now I already did a small console application which listen for the data and print out the data on the screen.

Now my plans are to deserialize the xml data or I will create the insert statement into the database.

1) The device send me the data every second (if there is data to send me).

2) I cannot say how much data the device is going to send me.

How can I make sure to capture all data without loose any information..

View 2 Replies

Get The Length Of Received Data Of Socket?

Mar 9, 2011

I built a server to receive data from clients.But how can I know the length of every data package.

Dim bteAcceptData(1024) As Byte
Dim myAsyncCallBack As New AsyncCallback(AddressOf ReceiveData)
intByte = EndSocket.EndReceive(pIAsyncResult)

[Code].....

View 2 Replies

More Than One Data Transaction Using Socket Programming

Oct 28, 2009

am developing an application where a client send data to server (socket Programing) and the server recevices it and shows it to the user through a list view but the client can send the data any time they want and it should show on the list view automatically... So i have put a timer and in tick event i have written the code like this the below code is working fine in onload event but then only once the client can send the data to the
server.

[Code]...

View 3 Replies

HSD 32 Bit Data Bus To Serial Converter Via A Microcontroller - Data Sniffer To Read The Data Bus (32Bit)

Sep 3, 2008

Im working on a HSD 32 bit data bus to serial converter via a microcontroller. Now first I want to make a sort of data sniffer to read the data bus (32Bit) .All on the controller side is working and the stream of bytes are coming in via RS232 as 4 bytes in HEX like FD,A5,45,8B . I already converted the bytes in Dec and ASCII to determine what is passed true the bus and how fast and stuff.. Now that is all correct and working very well if the LSB (least significant bit) of the 32 data bus is Data line 0 and the MSB (most significant bit) is Data line 31 but if that is not the case I need to invert the 32Bits (like as I would invert the connector on the bus) . How do I best do this using the 4 bytes I send from the micro controller.

Example:

(MSB) 01001000 01100101 01101100 01110000 (LSB)
HEX= 48 65 6C 70
DEC= 72,101,108,112
ASCII= H E L P

I need to invert it with a button to:

(MSB) 00001110 00110110 10100110 00010010 (LSB)
HEX= 0E 36 A6 12
DEC= 14,54,166,18
ASCII= (SO) 6 : (DC2)

View 3 Replies

.net - Socket Communication - Unusual Data Being Received

Feb 24, 2011

I am trying to communicate to a local AS3 Air app on my PC via sockets. The VB.Net app is acting as a server in this case while the Air app is a client. The .Net app sends data every 25ms to the Air app. I have not send any message termination. I just receive the data on Air app and process it.

[Code]...

View 2 Replies

Communications :: Parsing Data From Binary Socket

Sep 7, 2008

I am using VB.NET and I am designing a generic network architecture in which data can be transmitted in various ways. I am wanting to strip down things as much as possible, and I do not want to transmit in plain text. My question today is regarding ideas and example code (if applicable) as far as parsing binary data that is sent over the wire in VB.NET.I want each packet to have a very generic architecture such as <packet type> <address> <payload> or whatnot. I understand that I can use certain bytes as delimiters for these packet fields. I don't necessarily want to serialize everything being that for security reasons, the same library has to be used to deserialize the data.

a) Put my protocol into binary data where each field is delimited using a certain byte

b) Parse that data from binary at the other end.

Once again, I don't want to use plaintext since this can cause a bunch of overhead in comparison.

View 4 Replies

Receive Data Through A Socket Created In Another Process

Jul 29, 2009

I am trying to implement SMPP protocol in vb. I am sucessfull in send and receiving packets using sockets. Now I would like to decentralize the functions of my program. I want to implement two programs one for sending and another for receiving using a single socket. I want to receive data through the same socket that was created in another process(i.e., the first program).

View 1 Replies

VS 2010 Handle Receive Data On A Socket?

Sep 3, 2010

I've looked through a lot of snippets online and I see a lot of things similar to

Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))

but what I am unsure of when to call such a thing? How do I know when there is data to receive...in visual basic 6 with winsock, there was a specific routine which was called upon data arrival, but I see nothing of the sort for vbNet.

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

MSDN Socket - Call The Send Sub And Insert Data ?

Dec 21, 2011

I have been working on an ongoing project using socket communication.

I am using this code [URL]

The problem I am having is I am unable to figure out how to call the send sub and insert data into it. I have been able to do it before by removing the second class out and leaving it in the main class (if that makes any sense).

Imports System
Imports System.Net
Imports System.Net.Sockets

[CODE]...

These are the small modifications I have made to it so far. What I am trying to do is when I press a button, it calls a sub routine that takes the text input from a field and sends it to the send sub routine in this code.

View 7 Replies

TCP Client Error While Reading Data From Socket Server?

Apr 20, 2012

I have a TCP Socket Client (using the Socket Class) that is connected to a simple TCP socket server (just for testing)I have this code snippet :

Dim aSocket as Socket
While aSocket.Connected = True
byteRead = aSocket.Receive(dataByte) 'number of bytes

[code].....

View 1 Replies

Forms :: How To Create Dialog (Loading Data Please Wait)

Jun 13, 2007

My Startup form open very slow. How can I show a wait screen while Initialize Component. Then close this wait screen and show my Form.
You can see my attached image.

View 7 Replies

Use The .NET NetworkStream And TcpClient To Connect To A Remote IP And Wait For Data?

Oct 14, 2011

I am struggling a lot with this code I am trying to get to work. I have successfully made a connection with the TcpClient object to two separate remote machines and transmitted data to them. Essentially, I'm trying to connect to Machine 1 on port 80 and send a GET request. Once I send the request I want to keep the connection alive so that the software on the other side can send me data when it is ready. How do I keep the connection open and read data in each time it is made available in the stream? I have tried and tried using NetworkStream.Read and BeginRead to no avail. The closest I have come was sleeping my thread every 30 seconds and then doing another GET request which is not needed. Here is the current code I have for reading from the stream. I know I need a loop in here somewhere:Note: RemoteSocket is my TcpClient object that is connected by this point

Dim serverStream As NetworkStream = RemoteSocket.GetStream()
rqst = "GET /Control/Clip_Forwarding_Stream?CameraName=" & URL_Encode(Name) & " HTTP/1.0" & vbCrLf & vbCrLf

[code].....

View 2 Replies

Determine If System.Net.Sockets.Socket Has Outgoing Data Not Read?

Sep 18, 2009

Is there a way to determine if a System.Net.Sockets.Socket has sent data that has not been received/read by a specified remote endpoint with a connectionless protocol?It never hurts to try.

View 1 Replies

VB 2005 - Socket Send Only Few Peaces Of Data And Loose A Big Part Of It

Nov 25, 2009

i'm developing a server application using vb.net and i'm facing a problem. in fact i have a huge data to send to the client via the socket so i use a loop to divide the data and send each part the problem is that when i proceed with the sending the socket send me only few peaces of the data and loose a big part of it. i tried to flush the buffer after each sending but i didn't find how to do it so i used a system.threading. thread sleep between each socket send. it works when i don't have huge data but it blocks my server when the number of packets increases. is there a solution that would replace the. sleep one without blocking the application?

View 1 Replies

[2008] Error - Unable To Read Data From The Transport Connection: The Connection Was Closed

Mar 15, 2009

I have a simple scraper. It works on some websites, but on some there is this Error:

Quote:

IOException was unhandled Unable to read data from the transport connection: The connection was closed

It is occuring at "Dim htmlresults As String = Urlcontents.ReadToEnd()".

'Create the HttpWebRequest object
Dim req As HttpWebRequest = WebRequest.Create(URL)
'Set the timeout to 1 second (or 1,000 milliseconds)
req.Timeout = 10000

[code]....

View 2 Replies

Asynchronous Socket Programming Vb 2008(.net) Again Server Should Able To Send The Data To Client

Feb 2, 2011

I am facing problem in asynchronous socket communication.

1)I wanted to perform connect(from client to server) operation on enter button and send the data whatever client want to send and disconnect from server. And again client should get connect to server whenever client wanted to send data. this is the mechanism.

i.e how to reuse the socket.

2)Again Server should able to send the data to client.

View 5 Replies

Communications :: Real Time Data Collection From Socket And Storing In Excel

Jan 5, 2012

I m into automation development of FMCG products using Micro-controllers. I get real time data Barcode 2D from TCP/IP connection. My task is to compare the result do some Computation with them and Store the incoming Barcode and results into a Excel sheet in a folder. I m successful with the basic working. Am currently working at slow speed of 1 barcode(22 char info) per second from the TCP/IP data (barcode scanner). Now, comes the real issue. I need to process atleast 5 barcodes per sec ( <200ms per process). I m partially successful with 3 Barcode per second(300 ms per process). so, thats like 300ms per processing. I need to achieve less than 200ms for entire processing. I have used threads and timers. but I m unable to achieve. Seems like storing in Excel takes more than 250ms. Since i come from micro controllers background 1msec is a lotta time to process for me. I m not sure how much time does it take and trust me i find it difficult to guage the time here.

View 1 Replies







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