any body to help me to handle the winsock server hang when the server was sending and receiving after running for 1 - 2 hours. I am using VB (not VB.net).
The server will send the data from Comm port every second to many client.
I put delay 1 second in the client to send data ack after the client received the data from the server.
Any methode to handle this problem?Asyncro unous socket?
5 2907 sashi 1,754
Recognized Expert Top Contributor
any body to help me to handle the winsock server hang when the server was sending and receiving after running for 1 - 2 hours. I am using VB (not VB.net).
The server will send the data from Comm port every second to many client.
I put delay 1 second in the client to send data ack after the client received the data from the server.
Any methode to handle this problem?Asyncro unous socket?
Hi there,
How much of your server resources is being taken? What is the top processor usage measured? Check this details, good luck & take care.
Hi there,
How much of your server resources is being taken? What is the top processor usage measured? Check this details, good luck & take care.
Hi sashi,
I checked the cpu usage is only 15%.
The CPU is not hang, but My application is using TCP Socket server is hang when connect to client for 1-2 hours.
sashi 1,754
Recognized Expert Top Contributor
Hi sashi,
I checked the cpu usage is only 15%.
The CPU is not hang, but My application is using TCP Socket server is hang when connect to client for 1-2 hours.
Hi there,
Can you please post your code segment on your next post, it's alot more easier to debug you code in that way. Good luck & Take care.
here is my tcp server code
Private Sub Form_Load()
Me.Height = 7515
Me.Width = 11700
Me.Top = (Screen.Height - (Me.Height + EventMsg.Height )) / 2
Me.Left = (Screen.Width - Me.Width) / 2
'-----tcpServer listen
tcpServer(0).Lo calPort = 1001
tcpServer(0).Li sten
End Sub
Private Sub tcpServer_Conne ctionRequest(In dex As Integer, ByVal requestID As Long)
Dim sServerMsg As String
If Index = 0 Then
sRequestID = requestID
itcpServer = itcpServer + 1
Load tcpServer(itcpS erver)
tcpServer(itcpS erver).LocalPor t = 1001
tcpServer(itcpS erver).Accept requestID
End If
End Sub
rivate Sub tcpServer_DataA rrival(Index As Integer, ByVal bytesTotal As Long)
Dim omca_msg As String
Dim acu_msg As String
Dim track_msg As String
Dim lna_msg As String
Dim uc1_msg As String
Dim uc2_msg As String
Dim uc3_msg As String
Dim ucc_msg As String
Dim dc1_msg As String
Dim dc2_msg As String
Dim dc3_msg As String
Dim dcc_msg As String
Dim hpa1_msg As String
Dim hpa2_msg As String
Dim hpac_msg As String
Dim i As Long
Dim rec As String
Dim strtime As String
On Error Resume Next
Call tcpServer(Index ).GetData(rec)
strtime = Format(Time, "HH:MM:SS")
acu_msg = modAcu.SendACUs tatus
track_msg = TrackingReceive r.SendTracRcvst atus
lna_msg = ModLnaContr.Sen dLNAstatus
uc1_msg = "uc1_msg"
uc2_msg = "uc2_msg"
uc3_msg = "uc3_msg"
ucc_msg = "ucc_msg"
dc1_msg = "dc1_msg"
dc2_msg = "dc2_msg"
dc3_msg = "dc3_msg"
dcc_msg = "dcc_msg"
hpa1_msg = "hpa1_msg"
hpa2_msg = "hpa2_msg"
hpac_msg = "hpac_msg"
omca_msg = acu_msg & " " & track_msg & " " & lna_msg & " " & uc1_msg & " " & uc2_msg & " " & uc3_msg & " " & ucc_msg & " " & dc1_msg & " " & dc2_msg & " " & dc3_msg & " " & dcc_msg & " " & hpa1_msg & " " & hpa2_msg & " " & hpac_msg
tcpServer(Index ).SendData omca_msg
End Sub
thank you for your help
sashi 1,754
Recognized Expert Top Contributor
here is my tcp server code
Private Sub Form_Load()
Me.Height = 7515
Me.Width = 11700
Me.Top = (Screen.Height - (Me.Height + EventMsg.Height )) / 2
Me.Left = (Screen.Width - Me.Width) / 2
'-----tcpServer listen
tcpServer(0).Lo calPort = 1001
tcpServer(0).Li sten
End Sub
Private Sub tcpServer_Conne ctionRequest(In dex As Integer, ByVal requestID As Long)
Dim sServerMsg As String
If Index = 0 Then
sRequestID = requestID
itcpServer = itcpServer + 1
Load tcpServer(itcpS erver)
tcpServer(itcpS erver).LocalPor t = 1001
tcpServer(itcpS erver).Accept requestID
End If
End Sub
rivate Sub tcpServer_DataA rrival(Index As Integer, ByVal bytesTotal As Long)
Dim omca_msg As String
Dim acu_msg As String
Dim track_msg As String
Dim lna_msg As String
Dim uc1_msg As String
Dim uc2_msg As String
Dim uc3_msg As String
Dim ucc_msg As String
Dim dc1_msg As String
Dim dc2_msg As String
Dim dc3_msg As String
Dim dcc_msg As String
Dim hpa1_msg As String
Dim hpa2_msg As String
Dim hpac_msg As String
Dim i As Long
Dim rec As String
Dim strtime As String
On Error Resume Next
Call tcpServer(Index ).GetData(rec)
strtime = Format(Time, "HH:MM:SS")
acu_msg = modAcu.SendACUs tatus
track_msg = TrackingReceive r.SendTracRcvst atus
lna_msg = ModLnaContr.Sen dLNAstatus
uc1_msg = "uc1_msg"
uc2_msg = "uc2_msg"
uc3_msg = "uc3_msg"
ucc_msg = "ucc_msg"
dc1_msg = "dc1_msg"
dc2_msg = "dc2_msg"
dc3_msg = "dc3_msg"
dcc_msg = "dcc_msg"
hpa1_msg = "hpa1_msg"
hpa2_msg = "hpa2_msg"
hpac_msg = "hpac_msg"
omca_msg = acu_msg & " " & track_msg & " " & lna_msg & " " & uc1_msg & " " & uc2_msg & " " & uc3_msg & " " & ucc_msg & " " & dc1_msg & " " & dc2_msg & " " & dc3_msg & " " & dcc_msg & " " & hpa1_msg & " " & hpa2_msg & " " & hpac_msg
tcpServer(Index ).SendData omca_msg
End Sub
thank you for your help
Hi there,
Your code seems to be fine, another way to troubleshoot is to change the listening port to a higher port, try using 2xxxx onwards, hope it helps. Good luck & Take care.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: C. Alexander |
last post by:
Im running a small server that seems to work fine outside the IDE as an exe,
but within the IDE, when I run the program for the first time, i can
start/stop
the host many times. But I end the program within the IDE, and start it back
up,
when I click on the Host button, the entire IDE hangs.
I created a quick test program to try and figure out where the problem was..
Basically i created a form and put a command button, and a mswinsock
|
by: Dan |
last post by:
I'm writing a simplistic telnet client in VB6 and I've run into a small
snag. The program has a textbox to write in the string to be sent using
..SendData and has another textbox that displays what that server sends.
When I first connect to the server (in this case, my university's smtp
server), I get a response that the server acknowledges my connection. When
I type something into the textbox and send it, however, I get no response...
|
by: Chris Thompson |
last post by:
I'm trying to mess around with creating a multi-user server but I'm really
clueless as to how to start. I don't know what I'd need to do, and more than
likely it's over my head, but I'd still like to mess around. If anybody
could point me in the right direction it would be greatly appreciated.
|
by: Björn Pedersen |
last post by:
I'm having a tough time getting System.Net.Sockets to work with a server
that's based around Winsock 6.0. For many reasons I can't write a new server
because the server handles a number of client formats.
I'm writing a new client that should be able to connect to the Winsock-based
server. However, I can't get them to talk to each other. The server hears
and understands what System.Net.Sockets is saying, but when it tries to
respond...
|
by: Glen Conway |
last post by:
Hi,
I'm trying to use the gethostbyname function from wsock32.dll and failing dismally Has anyone got a successful implementation of this in VB.NET? My ulitimate goal is to resolve NetBIOS names to IP Addresses. I can use the framework DNS features if a DNS server is present on the network but this cannot use WINS if no DNS server is available.
Any help or pointers are apprecatiated. Here is the code I've managed to do so far. I've...
| |
by: Rain |
last post by:
Does anybody know where i can get a winsock class for C#? badly needed. ANy
help would be very much appreciated. Thank you so so much!
-Stan
|
by: Vincent |
last post by:
I do not have a strong grasp of the winsock library, but have started
fiddling around with it a bit. My first impression is that using
winsock in Access is a bit unwieldy. I was making a connection to a
daytime server on the Internet to retrieve the current date and time
and the only way I could reliably retrieve the information was to add a
timer event to the form from which I made the connection call. I would
basically use the timer...
|
by: Nicolas Ghesquiere |
last post by:
Hello
I have a problem with my current program.
The meaning of the program is to allow users to login to a server to allow
them to access the internet.
My program communicates with a MS isa server to make a rule for that IP for
the time-credits left for that user.
My problem is that so far, the program can handle everything except more
then one client, and i have done my best, but i can't find a decent solution
|
by: =?Utf-8?B?TWFydGluVGVlZnk=?= |
last post by:
Hi,
I've read a lot about the use of system sockets in Vb.net instead of winsock
fine but how do i get a vb.net service running on a 2003 server to send a
message to a desktop vb6 exe that can only use winsock?
So the service needs to send a message to the PC via some port say 8000.
The service knows the IP address of the PC also. The system socket code sends
the message and the VB6 exe has connected to the server on port 8000 but...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |