Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CanguruChatServer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fernando Erd
CanguruChatServer
Commits
7c1e7c76
Commit
7c1e7c76
authored
8 years ago
by
Fernando Erd
Browse files
Options
Downloads
Patches
Plain Diff
ARRUMEI O BUG
parent
8a00446f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Chat.py
+10
-10
10 additions, 10 deletions
Chat.py
with
10 additions
and
10 deletions
Chat.py
+
10
−
10
View file @
7c1e7c76
...
@@ -183,8 +183,14 @@ def server ():
...
@@ -183,8 +183,14 @@ def server ():
msg
,
cliente
=
udp
.
recvfrom
(
1024
)
msg
,
cliente
=
udp
.
recvfrom
(
1024
)
protocolDescompactMessage
.
setDesempacota
(
msg
)
protocolDescompactMessage
.
setDesempacota
(
msg
)
#Recebi o token
if
(
protocolDescompactMessage
.
type
==
'
0
'
and
TOKEN
==
0
):
print
'
RECEBI O TOKEN
'
TOKEN
=
1
StartTime
=
time
.
time
()
#A msg foi enviada com sucesso
#A msg foi enviada com sucesso
if
(
msg
[
1
]
==
'
2
'
and
int
(
MACHINE_ID
)
==
int
(
protocolDescompactMessage
.
destiny
)):
el
if
(
msg
[
1
]
==
'
2
'
and
int
(
MACHINE_ID
)
==
int
(
protocolDescompactMessage
.
destiny
)):
print
'
A MENSAGEM FOI ENVIADA COM SUCESSO
'
print
'
A MENSAGEM FOI ENVIADA COM SUCESSO
'
RECEBIDA
=
1
RECEBIDA
=
1
...
@@ -205,7 +211,6 @@ def server ():
...
@@ -205,7 +211,6 @@ def server ():
udp
.
sendto
(
msg
,
dest
)
udp
.
sendto
(
msg
,
dest
)
else
:
else
:
print
'
ERRO DE MENSAGEM
'
print
'
ERRO DE MENSAGEM
'
#envia nack
#envia nack
protocolDescompactMessage
.
type
=
str
(
3
)
protocolDescompactMessage
.
type
=
str
(
3
)
protocolDescompactMessage
.
destiny
=
protocolDescompactMessage
.
origin
protocolDescompactMessage
.
destiny
=
protocolDescompactMessage
.
origin
...
@@ -216,11 +221,6 @@ def server ():
...
@@ -216,11 +221,6 @@ def server ():
elif
(
msg
[
1
]
==
'
1
'
or
msg
[
2
]
==
'
2
'
or
msg
[
3
]
==
'
3
'
):
elif
(
msg
[
1
]
==
'
1
'
or
msg
[
2
]
==
'
2
'
or
msg
[
3
]
==
'
3
'
):
udp
.
sendto
(
msg
,
dest
)
udp
.
sendto
(
msg
,
dest
)
#Recebi o token
if
(
protocolDescompactMessage
.
type
==
'
0
'
and
TOKEN
==
0
):
print
'
RECEBI O TOKEN
'
TOKEN
=
1
StartTime
=
time
.
time
()
udp
.
close
()
udp
.
close
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment