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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 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