Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server very slow after 5min #84

Closed
mzelecom opened this issue Nov 14, 2021 · 1 comment
Closed

server very slow after 5min #84

mzelecom opened this issue Nov 14, 2021 · 1 comment

Comments

@mzelecom
Copy link

hi i used BeetleX in my game server vb.net.but after sometimes server become very slow.when 50 client connected.
this is my code.whats wrong?

`Imports BeetleX
Imports BeetleX.EventArgs
Imports System

Friend Class servers
Inherits ServerHandlerBase
Public server As IServer

Sub server_run()
    server = SocketFactory.CreateTcpServer(Of servers)()
    server.Options.DefaultListen.Port = 8283
    server.Options.SessionTimeOut = 300
    server.Open()
End Sub

Public Overrides Sub Connected(ByVal server As IServer, ByVal e As ConnectedEventArgs)
   
    main_form.Connected(server, e)
End Sub

Public Overrides Sub Disconnect(ByVal server As IServer, ByVal e As SessionEventArgs)
    main_form.Disconnect(server, e)
End Sub

Public Overrides Sub SessionReceive(ByVal server As IServer, ByVal e As SessionReceiveEventArgs)
    Dim pipeStream = e.Stream.ToPipeStream()
    Dim name As String = Nothing
    If pipeStream.TryReadLine(name) Then         
        main_form.SessionReceive(server, e, name)
    End If
End Sub

End Class`

@beetlex-io
Copy link
Owner

Winform is not thread-safe, Serverhandler accessing winform functionality may produce unintended results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants