Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

670 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