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
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
93038531
Commit
93038531
authored
8 years ago
by
Fernando Erd
Browse files
Options
Downloads
Patches
Plain Diff
Fix Error thread
parent
668627b2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Canguru/CanguruChat.py
+19
-15
19 additions, 15 deletions
Canguru/CanguruChat.py
with
19 additions
and
15 deletions
Canguru/CanguruChat.py
+
19
−
15
View file @
93038531
...
...
@@ -31,9 +31,9 @@ import threading
import
sys
import
binascii
MACHINE_ID
=
1
SEND_PORT
=
5000
# Porta que o Servidor envia
RECV_PORT
=
5000
# Porta que o Servidor recebe
MACHINE_ID
=
1
class
Protocol
():
def
__init__
(
self
):
...
...
@@ -98,6 +98,7 @@ class Protocol():
return
"
%08X
"
%
buff
def
client
():
try
:
udp
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
dest
=
(
HOST
,
SEND_PORT
)
print
'
Para sair digite exit
\n
'
...
...
@@ -119,6 +120,9 @@ def client ():
msg
=
protocolMessage
.
getEmpacotar
()
threadServer
.
_Thread__stop
()
udp
.
close
()
except
:
print
'
OPS, ALGO OCORREU ERRADO
'
threadServer
.
_Thread__stop
()
def
server
():
udp
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
...
...
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