Hello fellow .NET programmers. So i'm currently working on a chat, like Skype and i got it working! But since it's using PHP and it is making requests to my website each second it's a bit laggy. Then i used threads, and it certainly helped a lot, but just not enough. So earlier today i read about sockets, and if i understood it correctly i should be able to create a server, and of course a client that listens for new chat strings? How am i gonna do this? I hope that some of you guys can help me in the right direction. Of course i'm not looking for source code ready for CP. I'm here for learning!
|
.NET
PHP Chat changing to socket chat, if possible. Help me please |
(Feb 1, 2016 11:13 AM)Flzduden Wrote: It's a vb.net application that makes request to my mysql through php. I dont care about security right now either. I wanna know how it's working, before i go into security. Well if that's what you're looking for then I made this some time ago, https://hackforums.net/showthread.php?tid=4615781 Though I wouldn't recommend it, I'd recommend using sockets, but I guess it's good for learning purposes. (Feb 1, 2016 11:16 AM)+Haze Wrote: Well if that's what you're looking for then I made this some time ago, Yeah sockets is exactly what i'm trying to learn, i got totally misunderstood (probably my shitty english lol) I already HAVE made a php chat, but it's quite unstable.
Feb 2, 2016 09:52 AM
(This post was last modified: Feb 2, 2016 09:52 AM by Ninja.)
Code Private Sub formMain_Load(sender As Object, e As EventArgs) Handles MyBase.LoadSome code I had laying around. This should give you the general idea. (Feb 2, 2016 09:52 AM)Ninja Wrote: Why are you catching an Exception only to ignore it? Tut tut tut (Feb 2, 2016 09:52 AM)Ninja Wrote: :( You're also mixing between sync and async in that snippet.
Feb 2, 2016 01:45 PM
(This post was last modified: Feb 2, 2016 01:45 PM by Remix.)
(Feb 1, 2016 11:16 AM)+Haze Wrote: Well if that's what you're looking for then I made this some time ago, You have some PHP errors in the scripts 😠 Well they're more logical mistakes
Thanks for all the inputs. I found a few tutorials on the www, but i just dont get it really. All of those tut's can only send data one way. Like from the client to the server, or from the server to multiple clients. The client shouldn't act as a server in any way right? Cuz then all of those clients would have to port forward, and that's not the idea really.. Only the server host should portforward. Am i right on this?
Feb 2, 2016 03:37 PM
(This post was last modified: Feb 2, 2016 03:54 PM by Odus.)
(Feb 2, 2016 03:34 PM)Flzduden Wrote: Thanks for all the inputs. I found a few tutorials on the www, but i just dont get it really. All of those tut's can only send data one way. Like from the client to the server, or from the server to multiple clients. The client shouldn't act as a server in any way right? Cuz then all of those clients would have to port forward, and that's not the idea really.. Only the server host should portforward. Am i right on this? Think of it as reverse connection, just like with rats. It's still possible to communicate data between the client and server.
Feb 2, 2016 03:47 PM
(This post was last modified: Feb 2, 2016 03:48 PM by Flzduden.)
(Feb 2, 2016 03:37 PM)Odus Wrote: Think of it as reverse connection, the end users connect to you, just like with rats. It's still possible to communicate data between the client and server. wow, didn't think of it that way. I think i'm in the right direction now, i got i sending from client to server - and from server to client now. That's kinda what i would acheive from it. So thanks to everyone helping. Such a great forum.
Feb 2, 2016 04:20 PM
(This post was last modified: Feb 2, 2016 04:21 PM by Ninja.)
(Feb 2, 2016 09:52 AM)Ninja Wrote: At least know what you're doing before you start giving other people bad habits. |
|
|



