Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
skylivex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
astronomy
skylivex
Commits
03fe344b
Commit
03fe344b
authored
Feb 18, 2013
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now tcp connection is working
parent
856c910b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
15 deletions
+6
-15
skproto.cpp
plugins/skproto.cpp
+5
-14
skproto.h
plugins/skproto.h
+1
-1
No files found.
plugins/skproto.cpp
View file @
03fe344b
...
@@ -49,20 +49,12 @@ void SkyliveProtocol::startPlugin()
...
@@ -49,20 +49,12 @@ void SkyliveProtocol::startPlugin()
void
SkyliveProtocol
::
readFromNetwork
()
void
SkyliveProtocol
::
readFromNetwork
()
{
{
std
::
cout
<<
"Received From Skylive Serve"
;
char
buffer
[
50
];
QDataStream
in
(
tcpSocket
);
while
(
tcpSocket
->
bytesAvailable
())
in
.
setVersion
(
QDataStream
::
Qt_4_0
);
if
(
blockSize
==
0
)
{
{
if
(
tcpSocket
->
bytesAvailable
()
<
(
int
)
sizeof
(
quint16
))
tcpSocket
->
read
(
buffer
,
50
);
return
;
std
::
cout
<<
"Received From Skylive Server"
<<
buffer
<<
std
::
endl
;
in
>>
blockSize
;
}
}
if
(
tcpSocket
->
bytesAvailable
()
<
blockSize
)
return
;
QString
receivedTCP
;
in
>>
receivedTCP
;
std
::
cout
<<
"Received From Skylive Server"
<<
receivedTCP
.
toStdString
()
<<
std
::
endl
;
}
}
void
SkyliveProtocol
::
handle_connect
(
SKMessage
::
SKMessage
msg
)
void
SkyliveProtocol
::
handle_connect
(
SKMessage
::
SKMessage
msg
)
...
@@ -71,9 +63,8 @@ void SkyliveProtocol::handle_connect(SKMessage::SKMessage msg)
...
@@ -71,9 +63,8 @@ void SkyliveProtocol::handle_connect(SKMessage::SKMessage msg)
tcpSocket
=
new
QTcpSocket
(
this
);
tcpSocket
=
new
QTcpSocket
(
this
);
connect
(
tcpSocket
,
SIGNAL
(
readyRead
()),
this
,
SLOT
(
readFromNetwork
()));
connect
(
tcpSocket
,
SIGNAL
(
readyRead
()),
this
,
SLOT
(
readFromNetwork
()));
connect
(
tcpSocket
,
SIGNAL
(
error
(
QAbstractSocket
::
SocketError
)),
this
,
SLOT
(
displayError
(
QAbstractSocket
::
SocketError
)));
connect
(
tcpSocket
,
SIGNAL
(
error
(
QAbstractSocket
::
SocketError
)),
this
,
SLOT
(
displayError
(
QAbstractSocket
::
SocketError
)));
blockSize
=
0
;
tcpSocket
->
abort
();
tcpSocket
->
abort
();
tcpSocket
->
connectToHost
(
"
localhost"
,
8081
);
tcpSocket
->
connectToHost
(
"
www.skylive.name"
,
8080
);
}
}
void
SkyliveProtocol
::
receiveMessage
(
SKMessage
::
SKMessage
msg
)
void
SkyliveProtocol
::
receiveMessage
(
SKMessage
::
SKMessage
msg
)
...
...
plugins/skproto.h
View file @
03fe344b
...
@@ -54,7 +54,7 @@ class SkyliveProtocol : public QObject, SkylivexPluginInterface
...
@@ -54,7 +54,7 @@ class SkyliveProtocol : public QObject, SkylivexPluginInterface
QHash
<
QString
,
SKHandlerFunction
>
_handlers
;
QHash
<
QString
,
SKHandlerFunction
>
_handlers
;
QTcpSocket
*
tcpSocket
;
QTcpSocket
*
tcpSocket
;
QNetworkSession
*
networkSession
;
QNetworkSession
*
networkSession
;
quint16
blockSize
;
public
:
public
:
void
startPlugin
();
void
startPlugin
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment