Send Data Twice Over TCP Stream For It To Be Recognized?
May 17, 2009
I am sending data over a tcp connection but I need send it in pairs for it to be sent i.e. 1st Send (doesnt work), 2nd Send (works), third Send (doesnt work), fourth Send (works)
View 1 Replies
ADVERTISEMENT
May 25, 2012
in an winForm app in VS2010 win 7 compiling to x86, I try to do what Alvas.Audio seems to work. See (c# ex: [URL] for reference.
Dim data() As Byte = wr.ReadData(second * i, second)
The result give me data.length()=0. I do not have any exception, I can read format from it and whatever reader I use I got this problem.EDIT : After some tests, it seems like the uncompressed file I create in the first step (in PCM format, with .wav extension) can not be recognized by the Alvas.audio library for the second step. I must miss something around Audio file markups or something alike.
Here is the code that might be the source (basically this is step 1):
Dim functOut As String = String.Empty
Dim wr As Alvas.Audio.IAudioReader = Nothing
Dim fs As IO.FileStream = Nothing
[code]....
How can I write the resulted stream to be sure I can read it again later?
View 1 Replies
Oct 12, 2010
I would like to use the USB port power as source and use the an amplifier on D+/D- Twisted Pair signal wires as my command line. I saw a thread suggesting to use the output as PWM. How can I send a single byte or stream of bytes to the port. Is it possible to read status of the D+/D- if they are shorted together?
View 7 Replies
Oct 18, 2010
So i'm still goofing around with this chat app thing. Current when a user sends a message it sends to all clients connected. The server stores all clients and their IPs in a hash table, so what i want to do is each time a client joins, the server will broadcast the updated hashtable to each client. I know i can make a mess and get the server to broadcast each row of the hash table as a string but i think this way would be cleaner, either that or send the client object instead of the whole hash table.
[Code]...
View 3 Replies
Jun 7, 2010
How can I send and recieve serialized objects over a TCP connection with size and data type values in the header (within array(0) and array(1) values)?
I know how to serialize and send the object using
BinaryFormatter.Serialize
But on the receiving end I dont know the size of the obejct sent therefore I dont know when to stop reading the data stream. I also dont know how to take the recieved data and put it into an array of bytes().
View 2 Replies
Dec 27, 2009
I noticed when I send bitmap over a stream I have to close the stream where I sent it from in order to get it on the other end. Is there any way I can keep the stream open and send images and strings, or any other way of doing that? [code] 'I have to close the stream or it wont work, but I need to keep it open to send more images!
View 6 Replies
Sep 17, 2010
I've solved part of the problem, but something I've just realised is the information just isn't getting through and EVERY example I find uses a Console type application and what about us people who don't wanna develop a Console application? I don't but nooooo they don't seem to understand that at MS and put one example which uses exactly that.
[Code]...
View 4 Replies
Oct 13, 2009
I'm trying to send a XML serialized class over a network stream
the send is working
Dim IP As Net.IPAddress = System.Net.IPAddress.Parse(IPAddress)
Dim IPE As New Net.IPEndPoint(IP, 10003)
Dim TCPClient As New Net.Sockets.TcpClient
[Code]....
I always get an error {"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."} The XMLFile has the xml document in it most of the time and I can go on and everything works but 1 out of every 5 times it doesn't work at all and the XMLFile contains nothing ..
View 6 Replies
Jun 8, 2011
I'm thinking about how I'm going to connect a computer to a projector and I came to think if it is possible to send a live stream of a computers screen to another computer via for example TCP or some other protocol. It must be possible since for example TeamViewer and other long-distance IT-support applications can do this. The thing is that I dont have a clue about where to start. And is it difficult to output the stream once it's recieved?
[Code]...
View 1 Replies
Dec 8, 2009
I just converted the following code from c# to vb.net. It is functional and works correctly with my company's firmware/devices. My next challenge. Previous serialport code used much more readable structs which where then converted (after building a packet) into byte() automatically as part of the serialport encoding. (this is my understanding)How could I
1. morph byte arrays 'ToSocket' and 'ToMTP' below into structs and
2. convert into byte array for Socket.BeginSend(byte(),.....) to stream out to remote devices?
Imports System.ComponentModel
Imports System.Text
Imports System.Net.Sockets
[Code]....
View 3 Replies
May 5, 2011
Im making a desktop player for a online web radio, and for the program I wanna make it show all the stream info. Like the stream name, and such. However I dont know how to do this? I looked everywhere
The server url is setup like this "[URL]" And it has all the stream info and that there. So is there a way I can get the info from there onto like say a label? Live updates btw.
View 1 Replies
May 24, 2012
I am using a Data Grid View to display data that come in from a tcp stream. When the stream receives data, the data is parsed and placed at the top of the grid. These are my top 3 lines of the cell clicked event of the Data Grid View.
Code:
If SpotsGrid.CurrentRow.Index = Nothing Then Exit Sub
i = SpotsGrid.CurrentRow.Index
tempFreq = CStr(SpotsGrid.Item(1, i).Value)
I placed the top line there to prevent errors when a user clicks on a blank grid before any data has been placed in the grid and to stop selecting anything if a user clicks on a column header. But my problem is as data is added to the to the top line that line of data is not click-able because the index=0 or Nothing. So my question is what would be the best way to code this so it is protected from the user clicking on a blank grid and the column headers but still allow the user to click on the first line of data?
View 1 Replies
Aug 23, 2011
What are the best way to encrypt and decrypt stream of data ?I would like that my program read a file.. and unencrypt it in memory then when it save it.. it encrpyt the stream and save it.
View 1 Replies
Apr 1, 2009
I'm trying to set up a CLASS to represent a data stream.This is a newbie question so if the answer is obvious, please excuse me.Several of the data items are multiples which I would normally represent as an Array element.For example, in the code below, the element SolarNameplate has up to 10 instances, so I'd like to use array notation.I get errors, and it doesn't work, so I assume I can't do it like below.
QUESTIONS : 1 - is it possible to use an array element in a class ?
2 - is there another way to achieve what I want ?
Public Class SM1PS01
Private _Projid As String '... name or number of project
Private _LogoFile As String '... file containing customer logo[code]...........
View 18 Replies
May 22, 2009
I am working on a program that alters very large images. The images are usually in .tif or .bmp format. I load up the old image, copy a section of it into a new image, then save the new image. So far everything works my problem is that the images that i have to alter are 900mb+. Using the simple Bitmap class is not working because the images are quite apparently too large to fit into memory that way. (throwing an OutOfMemory exception)I want to step over the part of loading the image, and turn it into streaming the pixels from the image straight from the disk. I kind of have an idea of how to get the stream open and start reading, but I have no idea what to do with the 32bit integers that are being returned. how to stream pixel data from an image?
Dim oldImage As Bitmap
Try
oldImage = New Bitmap(file)
Catch ex As Exception
[code].....
View 3 Replies
Dec 30, 2008
I've set up a stream reader to get data from a serial file, functionality for that is already set up.
My problem is that the program seems to be missing out every other line of code in the file, which kinda defeats the point of a serial file. [code]...
View 2 Replies
Jul 14, 2010
This app is trying to send messages to a client listening on the port. The client's logs show that their port is being opened and closed, but no data coming in. Is there a bug or something missing in the following code, like perhaps stream.flush or stream.endwrite or a thread.sleep(0) line, that could cause this? The puzzling thing is, WireShark on the client computer does show the message my app is sending coming into the listening port.
[Code]...
View 3 Replies
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
Jul 2, 2011
Everyone seems to have their own TCP dilemma so I figured I'd ask this here and see what the pros have to say. Basically I need to connect to an IP 192.168.5.100, port 8000 and listen for all the data that is being sent out. When I Telnet to 192.168.5.100 8000, it shows as...
[Code]...
View 1 Replies
Jun 1, 2009
I have looked over this and can't see where i'm going wrong, all i'm trying to do is add an item to a listbox when i a tcpclient logs on to the server. Code in question... If i put a breakpoint in i can see that initialclientresponse is set correctly.
Public Sub ConnectClient()
Dim pendingClient As TcpClient
Dim InitialClientResponse As String
[code].....
View 8 Replies
Apr 1, 2009
I am looking to create a VB 2008 Express program which converts a data stream from a picoscope muscle sensor into a power output board which controls a mechanism. In simple terms when the Muscle sensor reaches a value of 0.8 V or higher I want the programme to send a text file to the power output control programme, and likewise when the sensor is below 0.2 V I want the power to be zero.
So 0.8 V > = send text file (0O=100%)
0.2 V < = send text file (0O=0%)
so when muscles being senced move the device turns on and off. I think I am successfully getting the data stream from the Picoscope which is plugged in the usb. I am using codes and examples that the programming guide for the device provided. [Code] I just need to now how to get the data to be displayed or how to tell the programme to do something with the data. The device also came with an example of how it can record data to an excel sheet if anyone needs the code to gain a better understanding.
View 20 Replies
Feb 1, 2009
I am downloading page data using the stream reader using readline.I want to concatenate each line into one long string for parsing The below line of code is not working: datajoined =dataline.Insert(datajoined.Length - 1, dataline.Length - 1)My inevitable goal here is to track stream data with a progress bar. But first I must learn to dload page data in chunks.
[Code]...
View 2 Replies
Jan 27, 2009
I am trying to make my application read data from a file. Then save the data back. However I keep getting an error which says the file is still open so cannot be edited. I also read that there is an issue with the streamreader and streamwriter do not close the program straight away. I was wondering if anyone had a way around this or any alternative ideas. Heres my code so far!
[Code]...
View 5 Replies
Sep 4, 2010
The RX data from the serial port is as follows:
FE FE FA E0 00 23 45 FD
I need to truncate everything else and just have positions 5, 6 and 7 output in the hex in a TEXTBOX. See below:
452300
Instead it will put the the whole steam in the textbox and it will be in decimal format, not hex.
View 3 Replies
May 25, 2009
I am sending data to server via TCP IP Connection. I am using a continuous loop at the server end - that accepts new clients and while streams can be read, it reads data stream.
The data is sent from the client with 2 leading bytes of data that represent the size of the packet of data sent and type of data.
My question is: how do I retrieve the size of the data packet and then check that this amount of data has been retrieved?
[Code].....
View 1 Replies
May 25, 2009
I am sending data to server via TCP IP Connection. I am using a continuous loop at the server end - that accepts new clients and while streams can be read, it reads data stream.
The data is sent from the client with 2 leading bytes of data that represent the size of the packet of data sent and type of data.
My question is: how do I retrieve the size of the data packet and then check that this amount of data has been retrieved?[code]...
View 9 Replies
Nov 22, 2011
I have a problem with the cryptostream, if i write the stream to a memorystream the memory that the stream used is still alocated and i have no way of unalocating it.what am i missingdoing wrong? im using-using on the streams,readers and crypto stuffs so the framework should shut them all down right? i tryed calling .close and .dispose but nothing ,in fact i moved it all over I have provided the sub that im using for the encrytion im in .net 4.5 so there is a lil async stuff but i know thats not the problem coz i moved this code out of my main app(.net 4) for testing to see if i could fix the problem.[code...]
View 12 Replies
Mar 29, 2012
Im trying to send data from a Windows Form to an aspx page and send back a response. Im running around in circles trying to make this work. The data im trying to send is 4 strings. So fare I have this in my code, using the build-in webclient in visual studio 2010, in the windows form sending to the aspx
[Code]...
View 2 Replies
Nov 14, 2011
I have two issues I am trying to correct...First am trying to get my listbox1 to be the selected Comport used to do the send data and get data back.
My second issue is its requiring me to send two times to get my read data back as complete data and has odd shapes with the data I get back in front of and after the regular txt.
Beware, I am very new at this so please take it easy on me... Most help I did find was for older versions I only have the 2010 Visual studio Professional...
Public Class Form1
Sub GetSerialPortNames()
End Sub
[CODE]...
View 6 Replies
Apr 28, 2011
In order to re-sort the data received in USB easier, I send the data array received in USB (declared as Byte) to a temporary array (declared as SByte) to re-sort. I declared the temporary array as SByte just for easy sorting. After I compiled, an error message came up "make sure not divided by zero". I tried to use convert.SByte but still didn't help. Is it not allowed to send data to an array with different data type declaration?
View 1 Replies