Jump to content

Same codes from Windows Application but cant compile the same way in Web Appilcation

- - - - -

  • Please log in to reply
2 replies to this topic

#1
baybay

baybay

    Newbie

  • Members
  • Pip
  • 1 posts
hi, why is it that the exact same codes that i use to create a Windows application, which is able to work, does not work on a Web application?

[ATTACH]3661[/ATTACH]
[ATTACH]3662[/ATTACH]

i created a windows application using c# and socket programming language. i will be connected to a remote server and through the windows application, and i will be able to send the "byte[] msg" to the server and activate the LED lightbulbs attached to the remote server. that exact same codes works well on the Windows application. however, when i create another Web application using the same exact codes, i does not have any error yet i am not able to activate the LED lightbulbs attached to it. is it that through the web or internet explorer i am not able to send the "byte[] msg" correctly or any other reasons? any help?

Attached Files



#2
cdg10620

cdg10620

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 389 posts
The program is still running successfully and you're not getting any errors yet the LED lights are not reacting to the web application? That would lead one to believe that the hardware isn't receiving the message that you are sending to it. Are you 100% certain that your web application has established a connection with the hardware?
-CDG10620
Software Developer

#3
sam_coder

sam_coder

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 372 posts
I cant see all the code, but I have to wonder if the problem is because you are relying on Async pattern..
I can see in the web page code, IAsyncResult... something

that would make sense, since on the server side, when the sync operation completes, the web browser wouldn't be notified.

generally speaking, in the web world, the client initiates all talking between the two, not arbitrary events that happen on the server.

If you are using asynchronous sockets, try switching to blocking, see what happens.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users