Sign in to follow this  
Followers 0
Hellouser

Urgent help in my Chat Program.

1 post in this topic

Hi All ,

Need an urgent help in my TCP IP chat program. I am developing a client server messaging application.In my application all the clients are connected to the server and the server will always monitor the data's from the clients.Initially when i restart the server i am getting some data's from clients and the server is able to process it. But after sometime the server application is getting data's from clients but its not coming in RecvData() function even though when they establish a new connection to the server .But its adding the socket details correctly.Below i have attached the core code also .

I want to make my server application is like, the server application will always monitor and process data's from the clients.

Here the function adduser is used to add a new user , its processing fine.

I have tested it by using Traytip.

Please help !!!

Core Code of My Application.

While 1

$Tray_Message = TrayGetMsg()

Switch $Tray_Message

Case $Tray_Menu_Shutdown

Exit

Case $Tray_Menu_Restart

_ArrayDisplay($User_List,"")

EndSwitch

_RecvData()

$New_Socket = TCPAccept($MainSocket)

If $New_Socket = -1 Then ContinueLoop

_AddUser($New_Socket)

WEnd

Func _RecvData()

Local $S_Time = ""

$Message = ""

$Incoming_Data = ""

For $x = 1 To $MaxUsers

If Not $User_List[$x][0] Then ContinueLoop

$Recv = TCPRecv($User_List[$x][0], 4096)

;If $Recv = "" Then ContinueLoop

;If @error Then _DelSocket($User_List[$x][0])

;$Recv = _StringDecryptRC4($Recv, $User_List[$x][2])

Traytip($x,$Recv,3)

next

EndFunc

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0