473,395 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

sockets (data arrival event)

1
Hi All,

I am currently sending a message to our Host (IBM mainframe), The message sending was successful as well as the reply of the Host. The problem is when the dataarrival event of my socket was triggered, the data I supposed to received were not displayed or cannot be manipulated though the 'sockedata' has values. How should I handle this? Thanks in advance

This was the sample code I made in .Net, I applied asynchronous comm.:

Public Sub Send(ByVal tmp_Data As String)
Try
Dim obj_StateObject As New StateObject
obj_StateObject.WorkSocket = m_tmpSocket
Dim BufferByte As Byte()
tmp_Data = ChrW("0") + _
ChrW("0") + _
ChrW("0") + _
ChrW(Len(tmp_Data)) + _
tmp_Data
BufferByte = AToB(tmp_Data)
m_tmpSocket.BeginSend(BufferByte, 0, _
BufferByte.Length, 0, _
New AsyncCallback(AddressOf onSendComplete), obj_StateObject)
Catch ex As Exception

End Try
End Sub

Private Sub onSendComplete(ByVal ar As IAsyncResult)
Dim obj_SocketState As StateObject = CType(ar.AsyncState, StateObject)
Dim obj_Socket As Socket = obj_SocketState.WorkSocket
Dim sck_Data As String
End Sub

Private Sub _socket_socketDataArrival(ByVal SocketID As String, ByVal SocketData As String) Handles _socket.socketDataArrival
Dim sRcvDta As String
sRcvDta = EbcAscConversion(SocketData)
textMessage.Text += sRcvDta 'SocketData & vbCrLf
End Sub
Jul 18 '07 #1
0 1266

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tero Saarni | last post by:
Hi, I have several threads communicating with each other using events stored in Queues. Threads block on Queue.get() until somebody publishes an event in thread's event queue. I need to add...
0
by: Gonçalo Rodrigues | last post by:
Hi, I have a problem with threads and sockets. I'll try to describe the problem in words with pseudo-code. I've been working on a few classes to make it easier to work with threads. This...
4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
0
by: deepak | last post by:
y objective is to retrieve data from a remote server through sockets.the Maximum no of sockets that can be opened are four. The component that has to be developed in .net which must be COM...
4
by: BadOmen | last post by:
Hi, What is the different between 'System.Net.Sockets.Socket' and 'System.Net.Sockets.TcpClient'? When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?? Yours, Jonas
3
by: Michael Maercker | last post by:
hi! i'm really not into networking at all and have now been asigned the task of porting a vb6-code into vb.net (compact framework, in this case) and the code uses the winsock-control. i quickly...
7
by: D. Patrick | last post by:
I need to duplicate the functionality of a java applet, and how it connects to a remote server. But, I don't have the protocol information or the java source code which was written years ago. ...
3
by: Daniel | last post by:
Hello, I can't seem to get my sockets code to work right. Here is what I have inside my RequestHandler handle() function: total_data= data = True...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.