File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,7 @@ class AudioServer {
34
34
AudioServer (int port=80 ) {
35
35
// the client returns 0 for avialableForWrite()
36
36
copier.setCheckAvailableForWrite (false );
37
- WiFiServer tmp (port);
38
- server = tmp;
37
+ setupServer (port);
39
38
}
40
39
41
40
@@ -50,8 +49,7 @@ class AudioServer {
50
49
this ->password = (char *)password;
51
50
// the client returns 0 for avialableForWrite()
52
51
copier.setCheckAvailableForWrite (false );
53
- WiFiServer tmp (port);
54
- server = tmp;
52
+ setupServer (port);
55
53
}
56
54
57
55
/* *
@@ -161,6 +159,11 @@ class AudioServer {
161
159
StreamCopy copier;
162
160
BaseConverter<int16_t > *converter_ptr = nullptr ;
163
161
162
+ void setupServer (int port) {
163
+ WiFiServer tmp (port);
164
+ server = tmp;
165
+ }
166
+
164
167
void connectWiFi () {
165
168
TRACED ();
166
169
if (WiFi.status () != WL_CONNECTED && network!=nullptr && password != nullptr ){
You can’t perform that action at this time.
0 commit comments