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
233 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now