Computer Science Canada .NET Commands Help |
Author: | Mash [ Mon Jan 26, 2009 5:23 pm ] | ||||||
Post subject: | .NET Commands Help | ||||||
Hi. I've created a working chat server/client thing which works fine for me locally on my computer (but using my external ip.) However I gave my friend the client and it gives him an error on "get : netStream, port" on line 32 of the below code. The idea of these 2 servers and 1 client is that the client first connects to the logon server which tells them how many users are connected to the server and therefore which port to connect on, and then the user is able to connect to the server on that port. (Much faster than using turing to check each port for connectivity.) When I run the servers on my own computer it works fine, even for multiple chat clients. Heres the client code:
Heres the main server:
Heres the "logon" server:
Anyone know the issue? Thanks. |
Author: | andrew. [ Mon Jan 26, 2009 6:06 pm ] |
Post subject: | RE:.NET Commands Help |
I'm no expert on Turing net commands, so I can't really pinpoint your problem. However, it may lie in the use of processes. Try not to use processes if it is possible. Put each thing in a procedure. Again, I am not good at net commands in Turing so I don't know if processes are required. |
Author: | saltpro15 [ Mon Jan 26, 2009 6:50 pm ] |
Post subject: | RE:.NET Commands Help |
After looking at your code I agree with andrew. There shouldn't be any other problem as far as I can tell |
Author: | Mash [ Mon Jan 26, 2009 8:11 pm ] |
Post subject: | Re: .NET Commands Help |
In Turings .NET commands without processes I cannot do the same things as with processes. Using a loop turing stops all processing until a user has connected with netStream (connections + 1) := Net.WaitForConnection (port + connections, ip). And it also stops everything for a get command. Using a process was the only way around I could find. Theres no way to check if a user is looking for a connection and only if a user is looking then connect him, you must sit at the Net.WaitForConnection function until a user connects and so I must be doing other things during this period of time with other connected users. Also, because the get command stops everything, I cannot, with the client, continually check for sent messages from other users until the user actually typed a message and pressed enter...so again a process I must use. I have not found any alternatives. If you guys know of any, tell me and I can try it without processes. To me, it doesnt seem like processes would be the issue since the error that occurs is on a line before any process is forked. Thanks. |
Author: | saltpro15 [ Mon Jan 26, 2009 9:04 pm ] |
Post subject: | RE:.NET Commands Help |
check Turing 4.1.1 netchat program, the code is similar to this, maybe comparing them will help you find your problem |
Author: | ProxyKaliber [ Thu May 25, 2017 10:39 am ] |
Post subject: | Re: .NET Commands Help |
Hello, I know this topic is old but I'm replying to just let you guys know that I'll be working on updating this code to the current version of turing as I'm getting more errors as described by the original poster. I'm in ICS4C and its a 4 way split between ICS3C, ICS3U, ICS4C, and ICS4U class and we are given more self exploration since the teacher has to focus his time a lot more on the grade 11 which is fine by me because I get to focus on my interests and I am actually motivated to try and work on this code. Let me know if there's anything I should know while I work on this. I'm new to net command and I refer a lot to this site as well as the turing keyword reference. Cheers, Kaliber P.S. BB Code Signature will be coming soon |
Author: | ProxyKaliber [ Mon May 29, 2017 9:52 am ] |
Post subject: | Re: .NET Commands Help |
Nevermind, I was mistake. It's all in seperate turing files. My bad. Apopologies. |