Solved

(Urgent) Obtain data into a buffer continuously and send this data over the win socket to a flash application

Posted on 2004-08-12
5
235 Views
Last Modified: 2008-01-09
Hi all,
       I am new to VB and VB .NET and i have to write an application that can continuously read data from a buffer and send this data over TCP socket to another application. Basically send it over the socket.
As i was not familiar with VB .NET socket application, i looked up VB 6.0 TCP client/server application and i got it working. I also got the VB server talk to the flash application over the socket.
Now, i am trying to migrate to VB .NET and am not finding helpful examples for the same.
Also, how do i read data continuously from a buffer and send it over the socket. While(1) seems to hang the application (standard exe).
Summary:
=======
1. Socket communication using .NET
2. Read continuously and send out

Any pointers, help code would be helpful.

thanks a bunch,
Sang
0
Comment
Question by:sanggeek
  • 2
5 Comments
 
LVL 4

Expert Comment

by:srcalc
ID: 11789689
OK, well your VB 6 sample probably used the Winsock control, which is not used in VB .NET. I found the MSDN sample on TCP/IP communication infinately helpful. You can find it in the 101 VB .NET samples, its called "Advanced .NET Framework (Networking) - Use Sockets"

http://www.microsoft.com/downloads/details.aspx?FamilyId=08E3D5F8-033D-420B-A3B1-3074505C03F3&displaylang=en
0
 

Author Comment

by:sanggeek
ID: 11795414
Hi,
  Thank you for pointing me to the website. I am learning from it.
All I want to achieve is this simple functionality of the following which is in VB 6.0, in VB .NET, be it using winsock or streamwriter, write. Especially, i want to be able to send a string (not bytes), and then send chr(0) - In VB .NET you cannot send a chr(0), i am not sure what the replacement is....
(this is because the client application assumes end of data to be chr(0).)

Any form of help would be appreciated
thanks again,
Sang

Private Sub cmdSend_Click()
    ' send data from the textbox
    Winsock.SendData txtChat.Text
    Winsock.SendData Chr(0)
    DoEvents
End Sub

Private Sub Form_Load()
    ' set up the socket to listen on port 10101
    Winsock.LocalPort = 10101
    Winsock.Listen
End Sub

0
 

Author Comment

by:sanggeek
ID: 11797766
Can you please delete this question and give me a refund.

I used the exact same code posted above by me using Winsock except one minor change and it worked.
thank you.
Sang
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 12143499
Submitted to PAQ with points refunded (200)

DarthMod
Community Support Moderator
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question