send message over network

Just starting out? Need help? Post your questions and find answers here.
Stephen
User
User
Posts: 21
Joined: Sat Oct 18, 2003 10:36 pm

send message over network

Post by Stephen »

case 3, i wanna send a message to user, i can get message but with no title or text, i can also send receive files.
can anyone help with it ans the server code aswell please


If InitNetwork() = 0
MessageRequester("Error", "Can't initialize the network !", 0)
End
EndIf

#Window_0 = 0

#ip = 1
#send = 3
#connect = 2

#StatusBar_0 = 0

Port = 6582

OpenWindow(0, 352, 71, 233, 95, #PB_Window_SystemMenu | #PB_Window_TitleBar , "Client")
If CreateStatusBar(0, WindowID())
EndIf
If CreateGadgetList(WindowID())
IPAddressGadget(1, 10, 10, 140, 20)
SetGadgetState(1,MakeIPAddress(127,0,0,1))
ButtonGadget(3, 160, 40, 60, 20, "Send")
ButtonGadget(2, 160, 10, 60, 20, "Connect")

Repeat

EventID = WaitWindowEvent()
If EventID = #PB_EventGadget
Select EventGadgetID()
Case 1
ip$ = IPString(GetGadgetState(1))
StatusBarText(0, 0, ip$)

Case 2
Result = ConnectionID = OpenNetworkConnection(ip$, Port)
If Result
MessageRequester("Info","Connected")
StatusBarText(0, 0, "Connected :)")
Else
MessageRequester("Info","Failed")
EndIf

Case 3
If ConnectionID
MessageRequester("Info","poo")
EndIf

EndSelect
EndIf

Until EventID = #PB_EventCloseWindow
EndIf
End
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

first sorry for my bad englich

Please go to this link and you have a code for a ChatClient and ChatServer from me.
In this Code you can see how you can send a message.
I hope thats good for you.

http://www.robsite.de/php/pureboard/vie ... highlight=

Nico Grüner
Post Reply