mirror of
https://github.com/caperren/school_archives.git
synced 2025-11-09 21:51:15 +00:00
Added work from my other class repositories before deletion
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="useProjectProfile" value="false" />
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.0 (C:\Program Files (x86)\Python36-32\python.exe)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Project1.iml" filepath="$PROJECT_DIR$/.idea/Project1.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e8fbfb95-4db2-4345-b73e-451d0fb8bbe5" name="Default" comment="" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FileEditorManager">
|
||||
<leaf>
|
||||
<file leaf-file-name="chatserve.py" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/chatserve/chatserve.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#0#11#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsGulpfileManager">
|
||||
<detection-done>true</detection-done>
|
||||
<sorting>DEFINITION_ORDER</sorting>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="-11" />
|
||||
<option name="y" value="-11" />
|
||||
<option name="width" value="3862" />
|
||||
<option name="height" value="2136" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
<manualOrder />
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="Project1" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="Project1" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="chatserve" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="Project1" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="Project1" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scratches" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="Project1" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="e8fbfb95-4db2-4345-b73e-451d0fb8bbe5" name="Default" comment="" />
|
||||
<created>1486776608884</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1486776608884</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-11" y="-11" width="3862" height="2136" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24986738" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="processedProjectFiles" value="true" />
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/chatserve/chatserve.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#0#11#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,172 @@
|
||||
#include "ChatClient.h"
|
||||
|
||||
ChatClient::ChatClient(int port_number, string hostname) {
|
||||
// Set the port number and hostname based on the constructor inputs
|
||||
this->__port_number = port_number;
|
||||
this->__host_name = hostname;
|
||||
|
||||
// Set flags to default values
|
||||
this->__run_flag = true;
|
||||
this->__set_user_handle_flag = true;
|
||||
this->__setup_client_connection_flag = true;
|
||||
this->__chat_with_server_flag = true;
|
||||
|
||||
// Print out the welcome screen
|
||||
cout << "########################################" << endl;
|
||||
cout << " Chat Client - Version 1.0 " << endl;
|
||||
cout << " Written by Corwin Perren " << endl;
|
||||
cout << "########################################" << endl;
|
||||
}
|
||||
|
||||
void ChatClient::set_handle(){
|
||||
// Ask the user for their handle
|
||||
string handle;
|
||||
cout << "Please enter your desired handle (10 characters max): ";
|
||||
getline(cin, handle);
|
||||
|
||||
// Pull out a 10 character substring to make sure we don't go over the limit
|
||||
handle = handle.substr(0, 10);
|
||||
|
||||
// Set the user's handle and printout
|
||||
this->__user_handle = handle;
|
||||
cout << "Handle set to: " << handle << "." << endl;
|
||||
cout << "########################################" << endl;
|
||||
}
|
||||
|
||||
void ChatClient::setup_connection(){
|
||||
// Print out who we're connecting to
|
||||
cout << "\n########################################" << endl;
|
||||
cout << "Attempting to connect to \"" << this->__host_name << "\" on port " << this->__port_number << "." << endl;
|
||||
|
||||
struct sockaddr_in serv_addr;
|
||||
struct hostent *server;
|
||||
|
||||
// Create a new Internet TCP socket file descriptor
|
||||
this->__inet_file_descriptor = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
// Make sure it was made successfully
|
||||
if(this->__inet_file_descriptor < 0 ){
|
||||
cout << "ERROR: Error opening socket. Exiting..." << endl;
|
||||
this->__run_flag = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Translate the input host name to usable struct by the library
|
||||
server = gethostbyname(this->__host_name.c_str());
|
||||
|
||||
// Verify that this worked. Will fail if the host doesn't exist
|
||||
if(server == NULL){
|
||||
cout << "Host does not exist. Exiting..." << endl;
|
||||
this->__run_flag = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Empty the sockaddr struct
|
||||
bzero((char *) &serv_addr, sizeof(serv_addr));
|
||||
|
||||
// Set the connection type
|
||||
serv_addr.sin_family = AF_INET;
|
||||
|
||||
// Copy over the connection information from gethostname above
|
||||
bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length);
|
||||
|
||||
// Set the port
|
||||
serv_addr.sin_port = htons(this->__port_number);
|
||||
|
||||
// Attempt to open the file descriptor with this connection information
|
||||
int connection_result = connect(this->__inet_file_descriptor, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
|
||||
|
||||
// Let the user know if this failed
|
||||
if(connection_result < 0){
|
||||
cout << "ERROR: Error connecting to server. Please check host and port. Exiting..." << endl;
|
||||
this->__run_flag = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// We made it here, so success! Connected!
|
||||
cout << "Connection to server successful!" << endl;
|
||||
cout << "Ready to chat. You send first!" << endl;
|
||||
cout << "########################################" << endl;
|
||||
}
|
||||
|
||||
void ChatClient::chat_with_server(){
|
||||
int result;
|
||||
|
||||
// Reset variables and print out user's handle for message prompt
|
||||
string handle_message(this->__user_handle + "> ");
|
||||
string user_message;
|
||||
cout << handle_message;
|
||||
|
||||
// Read in the user's message
|
||||
getline(cin, user_message);
|
||||
|
||||
// Make a complete version of the message to send that has their handle
|
||||
string full_message(handle_message + user_message);
|
||||
|
||||
// Write this data to the server
|
||||
result = write(this->__inet_file_descriptor, full_message.c_str(), strlen(full_message.c_str()));
|
||||
|
||||
// Let the user know if sending failed
|
||||
if(result < 0){
|
||||
cout << "ERROR: Error sending message. Connection may have been lost. Exiting..." << endl;
|
||||
this->__run_flag = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// If the user sent the quit message, close the socket and exit the program
|
||||
if(user_message.find("\\quit") != string::npos){
|
||||
close(this->__inet_file_descriptor);
|
||||
this->__run_flag = false;
|
||||
cout << "Closed connection with server!" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// Empty a receive buffer
|
||||
char buffer[1025];
|
||||
bzero(buffer, 1025);
|
||||
|
||||
// Read in a message from the server
|
||||
result = read(this->__inet_file_descriptor, buffer, 1024);
|
||||
|
||||
// If this failed, let the user know
|
||||
if(result < 0){
|
||||
cout << "ERROR: Error sending message. Connection may have been lost. Exiting..." << endl;
|
||||
this->__run_flag = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert the received byte array to a string
|
||||
string received_message(buffer);
|
||||
|
||||
// Check if the message from the server included the quit message. If so
|
||||
// close the socket and exit the program
|
||||
if(received_message.find("\\quit") != string::npos){
|
||||
close(this->__inet_file_descriptor);
|
||||
this->__run_flag = false;
|
||||
cout << "Server closed connection!" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// If this was a normal message, print it to the screen
|
||||
cout << received_message << endl;
|
||||
}
|
||||
|
||||
void ChatClient::run(){
|
||||
|
||||
// This is the main processing loop for the chat client. It starts by
|
||||
// getting the user's handle, then attempts to open a connection to the
|
||||
// server. If these are successful, then the user can chat with the server
|
||||
// until either the server of client quits.
|
||||
while(this->__run_flag){
|
||||
if(this->__set_user_handle_flag){
|
||||
this->set_handle();
|
||||
this->__set_user_handle_flag = false;
|
||||
}else if(this->__setup_client_connection_flag){
|
||||
this->setup_connection();
|
||||
this->__setup_client_connection_flag = false;
|
||||
}else if(this->__chat_with_server_flag){
|
||||
this->chat_with_server();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef CHATCLIENT_H
|
||||
#define CHATCLIENT_H
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
class ChatClient {
|
||||
public:
|
||||
ChatClient(int port_number, string hostname);
|
||||
|
||||
void set_handle();
|
||||
void setup_connection();
|
||||
void chat_with_server();
|
||||
void run();
|
||||
|
||||
private:
|
||||
int __port_number;
|
||||
string __host_name;
|
||||
|
||||
string __user_handle;
|
||||
|
||||
int __inet_file_descriptor;
|
||||
|
||||
bool __run_flag;
|
||||
|
||||
bool __set_user_handle_flag;
|
||||
bool __setup_client_connection_flag;
|
||||
bool __chat_with_server_flag;
|
||||
};
|
||||
|
||||
#endif /* CHATCLIENT_H */
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
all: clean build
|
||||
|
||||
build:
|
||||
g++ main.cpp ChatClient.h ChatClient.cpp -o chatclient
|
||||
|
||||
clean:
|
||||
rm -f chatclient
|
||||
@@ -0,0 +1,70 @@
|
||||
/////////////////////////////////////
|
||||
// Imports
|
||||
/////////////////////////////////////
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "ChatClient.h"
|
||||
|
||||
/////////////////////////////////////
|
||||
// Namespace Declarations
|
||||
/////////////////////////////////////
|
||||
using namespace std;
|
||||
|
||||
/////////////////////////////////////
|
||||
// Global Variables
|
||||
/////////////////////////////////////
|
||||
#define PORT_MIN 1024
|
||||
#define PORT_MAX 65535
|
||||
|
||||
#define UN_INIT "NOT INITIALIZED"
|
||||
|
||||
/////////////////////////////////////
|
||||
// Main Definition
|
||||
/////////////////////////////////////
|
||||
int main(int argc, char** argv) {
|
||||
// If there aren't enough arguments, quit and tell the user
|
||||
if(argc < 5){
|
||||
cout << "Not enough arguments. Exiting..." << endl;
|
||||
cout << "usage: chatclient -port [port_number] -hostname [host_name]" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int port = -1;
|
||||
string host(UN_INIT);
|
||||
|
||||
// Go through the arguments and pull out the port and hostname
|
||||
for(int i = 0 ; i < argc ; i++){
|
||||
char *argument = argv[i];
|
||||
if(string("-port").compare(argument) == 0){
|
||||
port = atoi(argv[i+1]);
|
||||
}else if(string("-hostname").compare(argument) == 0){
|
||||
host = string(argv[i+1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Do a quick check to make sure the port is valid
|
||||
if((port < PORT_MIN) || (port > PORT_MAX)){
|
||||
cout << "Incorrect port value entered. Exiting..." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Do the same with the host
|
||||
if(host.compare(UN_INIT) == 0){
|
||||
cout << "No hostname entered. Exiting..." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Make and instance of the chat client and run its main processing loop
|
||||
ChatClient client = ChatClient(port, host);
|
||||
client.run();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="100">
|
||||
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
|
||||
<df root="." name="0">
|
||||
<in>ChatClient.cpp</in>
|
||||
<in>ChatClient.h</in>
|
||||
<in>main.cpp</in>
|
||||
</df>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
projectFiles="false"
|
||||
kind="IMPORTANT_FILES_FOLDER">
|
||||
<itemPath>Makefile</itemPath>
|
||||
<itemPath>nbproject/private/launcher.properties</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceFolderFilter>^(nbproject)$</sourceFolderFilter>
|
||||
<sourceRootList>
|
||||
<Elem>.</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="Default" type="0">
|
||||
<toolsSet>
|
||||
<compilerSet>default</compilerSet>
|
||||
<dependencyChecking>false</dependencyChecking>
|
||||
<rebuildPropChanged>false</rebuildPropChanged>
|
||||
</toolsSet>
|
||||
<codeAssistance>
|
||||
</codeAssistance>
|
||||
<makefileType>
|
||||
<makeTool>
|
||||
<buildCommandWorkingDir>.</buildCommandWorkingDir>
|
||||
<buildCommand>${MAKE} -f Makefile</buildCommand>
|
||||
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
|
||||
<executablePath></executablePath>
|
||||
<ccTool>
|
||||
<incDir>
|
||||
<pElem></pElem>
|
||||
</incDir>
|
||||
</ccTool>
|
||||
</makeTool>
|
||||
<preBuild>
|
||||
<preBuildCommandWorkingDir>.</preBuildCommandWorkingDir>
|
||||
<preBuildCommand></preBuildCommand>
|
||||
</preBuild>
|
||||
</makefileType>
|
||||
<item path="ChatClient.cpp" ex="false" tool="1" flavor2="0">
|
||||
</item>
|
||||
<item path="ChatClient.h" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
<item path="main.cpp" ex="false" tool="1" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
||||
@@ -0,0 +1 @@
|
||||
# Automatic path mapper. CRC = 1
|
||||
@@ -0,0 +1 @@
|
||||
gmake: *** No targets. Stop.
|
||||
@@ -0,0 +1 @@
|
||||
C:/Users/Corwin Perren/Documents/GitHub/CS372/Project 1/chatclient/chatclient.cpp=C:/Users/Corwin Perren/Documents/GitHub/CS372/Project 1/chatclient#chatclient.cpp -o chatclient
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
*
|
||||
* Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
|
||||
* Other names may be trademarks of their respective owners.
|
||||
*
|
||||
* The contents of this file are subject to the terms of either the GNU
|
||||
* General Public License Version 2 only ("GPL") or the Common
|
||||
* Development and Distribution License("CDDL") (collectively, the
|
||||
* "License"). You may not use this file except in compliance with the
|
||||
* License. You can obtain a copy of the License at
|
||||
* http://www.netbeans.org/cddl-gplv2.html
|
||||
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
||||
* specific language governing permissions and limitations under the
|
||||
* License. When distributing the software, include this License Header
|
||||
* Notice in each file and include the License file at
|
||||
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the GPL Version 2 section of the License file that
|
||||
* accompanied this code. If applicable, add the following below the
|
||||
* License Header, with the fields enclosed by brackets [] replaced by
|
||||
* your own identifying information:
|
||||
* "Portions Copyrighted [year] [name of copyright owner]"
|
||||
*
|
||||
* If you wish your version of this file to be governed by only the CDDL
|
||||
* or only the GPL Version 2, indicate your decision by adding
|
||||
* "[Contributor] elects to include this software in this distribution
|
||||
* under the [CDDL or GPL Version 2] license." If you do not indicate a
|
||||
* single choice of license, a recipient has the option to distribute
|
||||
* your version of this file under either the CDDL, the GPL Version 2 or
|
||||
* to extend the choice of license to its licensees as provided above.
|
||||
* However, if you add GPL Version 2 code and therefore, elected the GPL
|
||||
* Version 2 license, then the option applies only if the new code is
|
||||
* made subject to such option by the copyright holder.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
// List of standard headers was taken in http://en.cppreference.com/w/c/header
|
||||
|
||||
#include <assert.h> // Conditionally compiled macro that compares its argument to zero
|
||||
#include <ctype.h> // Functions to determine the type contained in character data
|
||||
#include <errno.h> // Macros reporting error conditions
|
||||
#include <float.h> // Limits of float types
|
||||
#include <limits.h> // Sizes of basic types
|
||||
#include <locale.h> // Localization utilities
|
||||
#include <math.h> // Common mathematics functions
|
||||
#include <setjmp.h> // Nonlocal jumps
|
||||
#include <signal.h> // Signal handling
|
||||
#include <stdarg.h> // Variable arguments
|
||||
#include <stddef.h> // Common macro definitions
|
||||
#include <stdio.h> // Input/output
|
||||
#include <string.h> // String handling
|
||||
#include <stdlib.h> // General utilities: memory management, program utilities, string conversions, random numbers
|
||||
#include <time.h> // Time/date utilities
|
||||
#include <iso646.h> // (since C95) Alternative operator spellings
|
||||
#include <wchar.h> // (since C95) Extended multibyte and wide character utilities
|
||||
#include <wctype.h> // (since C95) Wide character classification and mapping utilities
|
||||
#ifdef _STDC_C99
|
||||
#include <complex.h> // (since C99) Complex number arithmetic
|
||||
#include <fenv.h> // (since C99) Floating-point environment
|
||||
#include <inttypes.h> // (since C99) Format conversion of integer types
|
||||
#include <stdbool.h> // (since C99) Boolean type
|
||||
#include <stdint.h> // (since C99) Fixed-width integer types
|
||||
#include <tgmath.h> // (since C99) Type-generic math (macros wrapping math.h and complex.h)
|
||||
#endif
|
||||
#ifdef _STDC_C11
|
||||
#include <stdalign.h> // (since C11) alignas and alignof convenience macros
|
||||
#include <stdatomic.h> // (since C11) Atomic types
|
||||
#include <stdnoreturn.h> // (since C11) noreturn convenience macros
|
||||
#include <threads.h> // (since C11) Thread library
|
||||
#include <uchar.h> // (since C11) UTF-16 and UTF-32 character utilities
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="100">
|
||||
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
|
||||
<df root="." name="0">
|
||||
<in>ChatClient.cpp</in>
|
||||
<in>ChatClient.h</in>
|
||||
<in>main.cpp</in>
|
||||
</df>
|
||||
</logicalFolder>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="Default" type="0">
|
||||
<toolsSet>
|
||||
<developmentServer>perrenc@flip2.engr.oregonstate.edu:22</developmentServer>
|
||||
<platform>2</platform>
|
||||
</toolsSet>
|
||||
<compile>
|
||||
<compiledirpicklist>
|
||||
<compiledirpicklistitem>.</compiledirpicklistitem>
|
||||
<compiledirpicklistitem>${AUTO_FOLDER}</compiledirpicklistitem>
|
||||
</compiledirpicklist>
|
||||
<compiledir>${AUTO_FOLDER}</compiledir>
|
||||
<compilecommandpicklist>
|
||||
<compilecommandpicklistitem>${MAKE} ${ITEM_NAME}.o</compilecommandpicklistitem>
|
||||
<compilecommandpicklistitem>${AUTO_COMPILE}</compilecommandpicklistitem>
|
||||
</compilecommandpicklist>
|
||||
<compilecommand>${AUTO_COMPILE}</compilecommand>
|
||||
</compile>
|
||||
<dbx_gdbdebugger version="1">
|
||||
<gdb_pathmaps>
|
||||
</gdb_pathmaps>
|
||||
<gdb_interceptlist>
|
||||
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
|
||||
</gdb_interceptlist>
|
||||
<gdb_options>
|
||||
<DebugOptions>
|
||||
</DebugOptions>
|
||||
</gdb_options>
|
||||
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
|
||||
</dbx_gdbdebugger>
|
||||
<nativedebugger version="1">
|
||||
<engine>gdb</engine>
|
||||
</nativedebugger>
|
||||
<runprofile version="9">
|
||||
<runcommandpicklist>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
|
||||
</runcommandpicklist>
|
||||
<runcommand>"${OUTPUT_PATH}"</runcommand>
|
||||
<rundir>.</rundir>
|
||||
<buildfirst>false</buildfirst>
|
||||
<terminal-type>0</terminal-type>
|
||||
<remove-instrumentation>0</remove-instrumentation>
|
||||
<environment>
|
||||
</environment>
|
||||
</runprofile>
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
*
|
||||
* Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
|
||||
* Other names may be trademarks of their respective owners.
|
||||
*
|
||||
* The contents of this file are subject to the terms of either the GNU
|
||||
* General Public License Version 2 only ("GPL") or the Common
|
||||
* Development and Distribution License("CDDL") (collectively, the
|
||||
* "License"). You may not use this file except in compliance with the
|
||||
* License. You can obtain a copy of the License at
|
||||
* http://www.netbeans.org/cddl-gplv2.html
|
||||
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
||||
* specific language governing permissions and limitations under the
|
||||
* License. When distributing the software, include this License Header
|
||||
* Notice in each file and include the License file at
|
||||
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the GPL Version 2 section of the License file that
|
||||
* accompanied this code. If applicable, add the following below the
|
||||
* License Header, with the fields enclosed by brackets [] replaced by
|
||||
* your own identifying information:
|
||||
* "Portions Copyrighted [year] [name of copyright owner]"
|
||||
*
|
||||
* If you wish your version of this file to be governed by only the CDDL
|
||||
* or only the GPL Version 2, indicate your decision by adding
|
||||
* "[Contributor] elects to include this software in this distribution
|
||||
* under the [CDDL or GPL Version 2] license." If you do not indicate a
|
||||
* single choice of license, a recipient has the option to distribute
|
||||
* your version of this file under either the CDDL, the GPL Version 2 or
|
||||
* to extend the choice of license to its licensees as provided above.
|
||||
* However, if you add GPL Version 2 code and therefore, elected the GPL
|
||||
* Version 2 license, then the option applies only if the new code is
|
||||
* made subject to such option by the copyright holder.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
// List of standard headers was taken in http://en.cppreference.com/w/cpp/header
|
||||
|
||||
#include <cstdlib> // General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search
|
||||
#include <csignal> // Functions and macro constants for signal management
|
||||
#include <csetjmp> // Macro (and function) that saves (and jumps) to an execution context
|
||||
#include <cstdarg> // Handling of variable length argument lists
|
||||
#include <typeinfo> // Runtime type information utilities
|
||||
#include <bitset> // std::bitset class template
|
||||
#include <functional> // Function objects, designed for use with the standard algorithms
|
||||
#include <utility> // Various utility components
|
||||
#include <ctime> // C-style time/date utilites
|
||||
#include <cstddef> // typedefs for types such as size_t, NULL and others
|
||||
#include <new> // Low-level memory management utilities
|
||||
#include <memory> // Higher level memory management utilities
|
||||
#include <climits> // limits of integral types
|
||||
#include <cfloat> // limits of float types
|
||||
#include <limits> // standardized way to query properties of arithmetic types
|
||||
#include <exception> // Exception handling utilities
|
||||
#include <stdexcept> // Standard exception objects
|
||||
#include <cassert> // Conditionally compiled macro that compares its argument to zero
|
||||
#include <cerrno> // Macro containing the last error number
|
||||
#include <cctype> // functions to determine the type contained in character data
|
||||
#include <cwctype> // functions for determining the type of wide character data
|
||||
#include <cstring> // various narrow character string handling functions
|
||||
#include <cwchar> // various wide and multibyte string handling functions
|
||||
#include <string> // std::basic_string class template
|
||||
#include <vector> // std::vector container
|
||||
#include <deque> // std::deque container
|
||||
#include <list> // std::list container
|
||||
#include <set> // std::set and std::multiset associative containers
|
||||
#include <map> // std::map and std::multimap associative containers
|
||||
#include <stack> // std::stack container adaptor
|
||||
#include <queue> // std::queue and std::priority_queue container adaptors
|
||||
#include <algorithm> // Algorithms that operate on containers
|
||||
#include <iterator> // Container iterators
|
||||
#include <cmath> // Common mathematics functions
|
||||
#include <complex> // Complex number type
|
||||
#include <valarray> // Class for representing and manipulating arrays of values
|
||||
#include <numeric> // Numeric operations on values in containers
|
||||
#include <iosfwd> // forward declarations of all classes in the input/output library
|
||||
#include <ios> // std::ios_base class, std::basic_ios class template and several typedefs
|
||||
#include <istream> // std::basic_istream class template and several typedefs
|
||||
#include <ostream> // std::basic_ostream, std::basic_iostream class templates and several typedefs
|
||||
#include <iostream> // several standard stream objects
|
||||
#include <fstream> // std::basic_fstream, std::basic_ifstream, std::basic_ofstream class templates and several typedefs
|
||||
#include <sstream> // std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream class templates and several typedefs
|
||||
#include <strstream> // std::strstream, std::istrstream, std::ostrstream(deprecated)
|
||||
#include <iomanip> // Helper functions to control the format or input and output
|
||||
#include <streambuf> // std::basic_streambuf class template
|
||||
#include <cstdio> // C-style input-output functions
|
||||
#include <locale> // Localization utilities
|
||||
#include <clocale> // C localization utilities
|
||||
#include <ciso646> // empty header. The macros that appear in iso646.h in C are keywords in C++
|
||||
#if __cplusplus >= 201103L
|
||||
#include <typeindex> // (since C++11) std::type_index
|
||||
#include <type_traits> // (since C++11) Compile-time type information
|
||||
#include <chrono> // (since C++11) C++ time utilites
|
||||
#include <initializer_list> // (since C++11) std::initializer_list class template
|
||||
#include <tuple> // (since C++11) std::tuple class template
|
||||
#include <scoped_allocator> // (since C++11) Nested allocator class
|
||||
#include <cstdint> // (since C++11) fixed-size types and limits of other types
|
||||
#include <cinttypes> // (since C++11) formatting macros , intmax_t and uintmax_t math and conversions
|
||||
#include <system_error> // (since C++11) defines std::error_code, a platform-dependent error code
|
||||
#include <cuchar> // (since C++11) C-style Unicode character conversion functions
|
||||
#include <array> // (since C++11) std::array container
|
||||
#include <forward_list> // (since C++11) std::forward_list container
|
||||
#include <unordered_set> // (since C++11) std::unordered_set and std::unordered_multiset unordered associative containers
|
||||
#include <unordered_map> // (since C++11) std::unordered_map and std::unordered_multimap unordered associative containers
|
||||
#include <random> // (since C++11) Random number generators and distributions
|
||||
#include <ratio> // (since C++11) Compile-time rational arithmetic
|
||||
#include <cfenv> // (since C++11) Floating-point environment access functions
|
||||
#include <codecvt> // (since C++11) Unicode conversion facilities
|
||||
#include <regex> // (since C++11) Classes, algorithms and iterators to support regular expression processing
|
||||
#include <atomic> // (since C++11) Atomic operations library
|
||||
#include <ccomplex> // (since C++11)(deprecated in C++17) simply includes the header <complex>
|
||||
#include <ctgmath> // (since C++11)(deprecated in C++17) simply includes the headers <ccomplex> (until C++17)<complex> (since C++17) and <cmath>: the overloads equivalent to the contents of the C header tgmath.h are already provided by those headers
|
||||
#include <cstdalign> // (since C++11)(deprecated in C++17) defines one compatibility macro constant
|
||||
#include <cstdbool> // (since C++11)(deprecated in C++17) defines one compatibility macro constant
|
||||
#include <thread> // (since C++11) std::thread class and supporting functions
|
||||
#include <mutex> // (since C++11) mutual exclusion primitives
|
||||
#include <future> // (since C++11) primitives for asynchronous computations
|
||||
#include <condition_variable> // (since C++11) thread waiting conditions
|
||||
#endif
|
||||
#if __cplusplus >= 201300L
|
||||
#include <shared_mutex> // (since C++14) shared mutual exclusion primitives
|
||||
#endif
|
||||
#if __cplusplus >= 201500L
|
||||
#include <any> // (since C++17) std::any class template
|
||||
#include <optional> // (since C++17) std::optional class template
|
||||
#include <variant> // (since C++17) std::variant class template
|
||||
#include <memory_resource> // (since C++17) Polymorphic allocators and memory resources
|
||||
#include <string_view> // (since C++17) std::basic_string_view class template
|
||||
#include <execution> // (since C++17) Predefined execution policies for parallel versions of the algorithms
|
||||
#include <filesystem> // (since C++17) std::path class and supporting functions
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
# Launchers File syntax:
|
||||
#
|
||||
# [Must-have property line]
|
||||
# launcher1.runCommand=<Run Command>
|
||||
# [Optional extra properties]
|
||||
# launcher1.displayName=<Display Name, runCommand by default>
|
||||
# launcher1.hide=<true if lancher is not visible in menu, false by default>
|
||||
# launcher1.buildCommand=<Build Command, Build Command specified in project properties by default>
|
||||
# launcher1.runDir=<Run Directory, ${PROJECT_DIR} by default>
|
||||
# launcher1.runInOwnTab=<false if launcher reuse common "Run" output tab, true by default>
|
||||
# launcher1.symbolFiles=<Symbol Files loaded by debugger, ${OUTPUT_PATH} by default>
|
||||
# launcher1.env.<Environment variable KEY>=<Environment variable VALUE>
|
||||
# (If this value is quoted with ` it is handled as a native command which execution result will become the value)
|
||||
# [Common launcher properties]
|
||||
# common.runDir=<Run Directory>
|
||||
# (This value is overwritten by a launcher specific runDir value if the latter exists)
|
||||
# common.env.<Environment variable KEY>=<Environment variable VALUE>
|
||||
# (Environment variables from common launcher are merged with launcher specific variables)
|
||||
# common.symbolFiles=<Symbol Files loaded by debugger>
|
||||
# (This value is overwritten by a launcher specific symbolFiles value if the latter exists)
|
||||
#
|
||||
# In runDir, symbolFiles and env fields you can use these macroses:
|
||||
# ${PROJECT_DIR} - project directory absolute path
|
||||
# ${OUTPUT_PATH} - linker output path (relative to project directory path)
|
||||
# ${OUTPUT_BASENAME}- linker output filename
|
||||
# ${TESTDIR} - test files directory (relative to project directory path)
|
||||
# ${OBJECTDIR} - object files directory (relative to project directory path)
|
||||
# ${CND_DISTDIR} - distribution directory (relative to project directory path)
|
||||
# ${CND_BUILDDIR} - build directory (relative to project directory path)
|
||||
# ${CND_PLATFORM} - platform name
|
||||
# ${CND_CONF} - configuration name
|
||||
# ${CND_DLIB_EXT} - dynamic library extension
|
||||
#
|
||||
# All the project launchers must be listed in the file!
|
||||
#
|
||||
# launcher1.runCommand=...
|
||||
# launcher2.runCommand=...
|
||||
# ...
|
||||
# common.runDir=...
|
||||
# common.env.KEY=VALUE
|
||||
|
||||
# launcher1.runCommand=<type your run command here>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<code-assistance-data xmlns="http://www.netbeans.org/ns/make-project-private/1">
|
||||
<code-model-enabled>true</code-model-enabled>
|
||||
</code-assistance-data>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project-private/1">
|
||||
<activeConfTypeElem>0</activeConfTypeElem>
|
||||
<activeConfIndexElem>0</activeConfIndexElem>
|
||||
</data>
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group>
|
||||
<file>file:/C:/Users/Corwin%20Perren/Documents/GitHub/CS372/Project%201/chatclient/Makefile</file>
|
||||
<file>file:/C:/Users/Corwin%20Perren/Documents/GitHub/CS372/Project%201/chatclient/main.cpp</file>
|
||||
<file>file:/C:/Users/Corwin%20Perren/Documents/GitHub/CS372/Project%201/chatclient/ChatClient.cpp</file>
|
||||
<file>file:/C:/Users/Corwin%20Perren/Documents/GitHub/CS372/Project%201/chatclient/ChatClient.h</file>
|
||||
</group>
|
||||
</open-files>
|
||||
</project-private>
|
||||
@@ -0,0 +1,7 @@
|
||||
#Sat Feb 11 19:58:28 PST 2017
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 1\\chatclient\\nbproject\\project.xml=c1486869276305
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 1\\chatclient\\chatclient.h=c1486871212917
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 1\\chatclient\\makefile=c1486861630590
|
||||
VERSION=1.3
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 1\\chatclient\\chatclient.cpp=c1486871902016
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 1\\chatclient\\main.cpp=c1486871294940
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.cnd.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
<name>chatclient</name>
|
||||
<c-extensions/>
|
||||
<cpp-extensions>cpp</cpp-extensions>
|
||||
<header-extensions>h</header-extensions>
|
||||
<sourceEncoding>UTF-8</sourceEncoding>
|
||||
<make-dep-projects/>
|
||||
<sourceRootList>
|
||||
<sourceRootElem>.</sourceRootElem>
|
||||
</sourceRootList>
|
||||
<confList>
|
||||
<confElem>
|
||||
<name>Default</name>
|
||||
<type>0</type>
|
||||
</confElem>
|
||||
</confList>
|
||||
<formatting>
|
||||
<project-formatting-style>false</project-formatting-style>
|
||||
</formatting>
|
||||
</data>
|
||||
<spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
|
||||
<word>chatclient</word>
|
||||
<word>Corwin</word>
|
||||
<word>hostname</word>
|
||||
<word>Namespace</word>
|
||||
<word>Perren</word>
|
||||
<word>uit</word>
|
||||
</spellchecker-wordlist>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Remote Python 3.3.2 (ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PublishConfigData" autoUpload="Always" serverName="Flip2">
|
||||
<serverData>
|
||||
<paths name="Flip2">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
<mapping deploy="/chatserve" local="$PROJECT_DIR$" web="/" />
|
||||
</mappings>
|
||||
</serverdata>
|
||||
</paths>
|
||||
</serverData>
|
||||
<option name="myAutoUpload" value="ALWAYS" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="Corwin Perren">
|
||||
<words>
|
||||
<w>chatserv</w>
|
||||
<w>portnum</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
||||
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="useProjectProfile" value="false" />
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Remote Python 3.3.2 (ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/chatserve.iml" filepath="$PROJECT_DIR$/.idea/chatserve.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="WebServers">
|
||||
<option name="servers">
|
||||
<webServer id="2c010d92-d65b-4c65-9ba2-168de7fb126a" name="Flip2" url="http://flip2.engr.oregonstate.edu">
|
||||
<fileTransfer host="flip2.engr.oregonstate.edu" port="22" rootFolder="/nfs/stak/students/p/perrenc" accessType="SFTP">
|
||||
<advancedOptions>
|
||||
<advancedOptions dataProtectionLevel="Private" />
|
||||
</advancedOptions>
|
||||
<option name="port" value="22" />
|
||||
</fileTransfer>
|
||||
</webServer>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,521 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c7e71c04-9c06-43a2-99ac-299e9f007f53" name="Default" comment="" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="CoverageDataManager">
|
||||
<SUITE FILE_PATH="coverage/chatserve$chatserve__args__Local_Launch.coverage" NAME="chatserve (args) Local Launch Coverage Results" MODIFIED="1486776553924" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/chatserve$chatclient__args__Remote_Launch.coverage" NAME="chatclient (args) Remote Launch Coverage Results" MODIFIED="1486783979813" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/chatserve$chatserve__args__Remote_Launch.coverage" NAME="chatserve (args) Remote Launch Coverage Results" MODIFIED="1486788413036" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/chatserve$chatserve__default__Remote_Launch.coverage" NAME="chatserve (default) Remote Launch Coverage Results" MODIFIED="1486777261453" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FileEditorManager">
|
||||
<splitter split-orientation="horizontal" split-proportion="0.5">
|
||||
<split-first>
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="450">
|
||||
<file leaf-file-name="chatserve.py" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/chatserve.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1626">
|
||||
<caret line="158" column="74" lean-forward="false" selection-start-line="158" selection-start-column="74" selection-end-line="158" selection-end-column="74" />
|
||||
<folding>
|
||||
<element signature="e#86#97#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</split-first>
|
||||
<split-second>
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="450">
|
||||
<file leaf-file-name="chatclient.py" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/chatclient.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="850">
|
||||
<caret line="34" column="0" lean-forward="false" selection-start-line="34" selection-start-column="0" selection-end-line="34" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</split-second>
|
||||
</splitter>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Python Script" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>self.add_to_print</find>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace>print</replace>
|
||||
</replaceStrings>
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/chatclient.py" />
|
||||
<option value="$PROJECT_DIR$/chatserve.py" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsGulpfileManager">
|
||||
<detection-done>true</detection-done>
|
||||
<sorting>DEFINITION_ORDER</sorting>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="-11" />
|
||||
<option name="y" value="-11" />
|
||||
<option name="width" value="3862" />
|
||||
<option name="height" value="2136" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
<manualOrder />
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scratches" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="chatserve" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="chatserve" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="nodejs_interpreter_path" value="C:/Program Files/nodejs/node" />
|
||||
<property name="js.eslint.eslintPackage" value="" />
|
||||
<property name="js-jscs-nodeInterpreter" value="C:\Program Files\nodejs\node.exe" />
|
||||
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/chatclient.py" />
|
||||
<property name="restartRequiresConfirmation" value="false" />
|
||||
</component>
|
||||
<component name="RunManager" selected="Python.chatserve (args) Remote Launch">
|
||||
<configuration default="true" type="DjangoTestsConfigurationType" factoryName="Django tests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="TARGET" value="" />
|
||||
<option name="SETTINGS_FILE" value="" />
|
||||
<option name="CUSTOM_SETTINGS" value="false" />
|
||||
<option name="USE_OPTIONS" value="false" />
|
||||
<option name="OPTIONS" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
|
||||
<config-file value="" />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PyBehaveRunConfigurationType" factoryName="Behave">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="ADDITIONAL_ARGS" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PyLettuceRunConfigurationType" factoryName="Lettuce">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="ADDITIONAL_ARGS" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="Tox" factoryName="Tox">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<module name="chatserve" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
|
||||
<node-interpreter>project</node-interpreter>
|
||||
<node-options />
|
||||
<gulpfile />
|
||||
<tasks />
|
||||
<arguments />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
|
||||
<command value="run" />
|
||||
<scripts />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Attests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Doctests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Nosetests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="PARAMS" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Unittests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="PUREUNITTEST" value="true" />
|
||||
<option name="PARAMS" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="py.test">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="testToRun" value="" />
|
||||
<option name="keywords" value="" />
|
||||
<option name="params" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<option name="USE_KEYWORD" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="chatserve (args) Remote Launch" type="PythonConfigurationType" factoryName="Python" singleton="true">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/chatserve.py" />
|
||||
<option name="PARAMETERS" value="-port 33210 -handle "CorwinServer"" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="chatclient (args) Remote Launch" type="PythonConfigurationType" factoryName="Python">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="chatserve" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/chatclient.py" />
|
||||
<option name="PARAMETERS" value="-address "127.0.0.1" -portnum 33207 -handle "Corwin's Client"" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<list size="2">
|
||||
<item index="0" class="java.lang.String" itemvalue="Python.chatserve (args) Remote Launch" />
|
||||
<item index="1" class="java.lang.String" itemvalue="Python.chatclient (args) Remote Launch" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="c7e71c04-9c06-43a2-99ac-299e9f007f53" name="Default" comment="" />
|
||||
<created>1486775598188</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1486775598188</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-11" y="-11" width="3862" height="2136" extended-state="6" />
|
||||
<editor active="false" />
|
||||
<layout>
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15331565" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32972136" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18421052" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32972136" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="processedProjectFiles" value="true" />
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/chatserve.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="3875">
|
||||
<caret line="158" column="74" lean-forward="false" selection-start-line="158" selection-start-column="74" selection-end-line="158" selection-end-column="74" />
|
||||
<folding>
|
||||
<element signature="e#86#97#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/chatclient.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/chatserve.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#86#97#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/chatclient.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/chatserve.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#86#97#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/chatclient.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/chatclient.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="850">
|
||||
<caret line="34" column="0" lean-forward="false" selection-start-line="34" selection-start-column="0" selection-end-line="34" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/chatserve.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1626">
|
||||
<caret line="158" column="74" lean-forward="false" selection-start-line="158" selection-start-column="74" selection-end-line="158" selection-end-column="74" />
|
||||
<folding>
|
||||
<element signature="e#86#97#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,36 @@
|
||||
import socket
|
||||
import atexit
|
||||
|
||||
TCP_IP = '127.0.0.1'
|
||||
TCP_PORT = 33211
|
||||
BUFFER_SIZE = 1024
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((TCP_IP, TCP_PORT))
|
||||
|
||||
|
||||
def at_exit():
|
||||
global s
|
||||
s.close()
|
||||
|
||||
atexit.register(at_exit)
|
||||
|
||||
while True:
|
||||
print("Steve> ", end="")
|
||||
my_input = input()
|
||||
s.send(bytes("Steve> " + my_input, "utf-8"))
|
||||
|
||||
if my_input == "\quit":
|
||||
s.close()
|
||||
exit()
|
||||
|
||||
received_data = None
|
||||
while not received_data:
|
||||
received_data = s.recv(1024).decode("utf-8")
|
||||
|
||||
first_word_block_after_handle = received_data.split("> ")[1]
|
||||
|
||||
if first_word_block_after_handle == "\quit":
|
||||
s.close()
|
||||
exit()
|
||||
|
||||
print(received_data)
|
||||
@@ -0,0 +1,164 @@
|
||||
#####################################
|
||||
# Imports
|
||||
#####################################
|
||||
import time
|
||||
import socket
|
||||
import sys
|
||||
import atexit
|
||||
|
||||
#####################################
|
||||
# Global Variables
|
||||
#####################################
|
||||
LOCAL_IP = "127.0.0.1"
|
||||
|
||||
PORT_MIN = 1024
|
||||
PORT_MAX = 65535
|
||||
|
||||
QUIT_STRING = "\quit"
|
||||
|
||||
|
||||
#####################################
|
||||
# Chat Server Class Definition
|
||||
#####################################
|
||||
class ChatServer:
|
||||
def __init__(self, port_number, server_handle):
|
||||
super(ChatServer, self).__init__()
|
||||
|
||||
# ########## Thread Flags ##########
|
||||
self.run_flag = True
|
||||
self.setup_server_flag = True
|
||||
self.wait_for_client_flag = True
|
||||
self.chat_with_client_flag = True
|
||||
|
||||
# ########## Class Variables ##########
|
||||
self.port_number = port_number
|
||||
self.handle = server_handle
|
||||
|
||||
self.socket = None
|
||||
|
||||
self.client_address = None
|
||||
self.client_port = None
|
||||
self.client_connection = None # type: socket.socket
|
||||
|
||||
# ########## Handle the socket closing so we don't keep it open ##########
|
||||
atexit.register(self.on_program_should_exit)
|
||||
|
||||
# ########## Start server ##########
|
||||
self.run()
|
||||
|
||||
def run(self):
|
||||
while self.run_flag:
|
||||
if self.setup_server_flag:
|
||||
self.setup_server()
|
||||
self.setup_server_flag = False
|
||||
elif self.wait_for_client_flag:
|
||||
self.wait_for_client()
|
||||
self.wait_for_client_flag = False
|
||||
elif self.chat_with_client_flag:
|
||||
self.chat_with_client()
|
||||
|
||||
time.sleep(0.1)
|
||||
|
||||
def setup_server(self):
|
||||
print("########################################")
|
||||
print(" Chat Server - Version 1.0 ")
|
||||
print(" Written by Corwin Perren ")
|
||||
print("########################################")
|
||||
print("Attempting to bind socket at IP \"" + LOCAL_IP + "\" on port " + str(self.port_number) + ".")
|
||||
|
||||
# Try to setup a socket and bind to it. If the bind it successful, begin listening on the socket.
|
||||
try:
|
||||
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.socket.bind((LOCAL_IP, self.port_number))
|
||||
self.socket.listen(1)
|
||||
print("Bind successful!")
|
||||
print("########################################")
|
||||
except:
|
||||
print("ERROR: Failed to bind socket. Please try a different port. Exiting...")
|
||||
self.run_flag = False
|
||||
|
||||
def wait_for_client(self):
|
||||
print("\n########################################")
|
||||
print("Waiting for client connection.")
|
||||
|
||||
# Wait for a client to connect, and accept the connection when they do
|
||||
self.client_connection, (self.client_address, self.client_port) = self.socket.accept()
|
||||
|
||||
print("Connected to client at IP \"" + self.client_address + "\" on port " + str(self.client_port) + ".")
|
||||
print("Ready to chat. Client sends first!")
|
||||
print("########################################")
|
||||
|
||||
def chat_with_client(self):
|
||||
# Decode the byte data back into a python string. Allow up to 1024 bytes for the message.
|
||||
received_data = self.client_connection.recv(1024).decode("utf-8") # type: str
|
||||
|
||||
# If the data is not empty
|
||||
if received_data:
|
||||
# Get the data after the handle printout
|
||||
first_word_block_after_handle = received_data.split("> ")[1]
|
||||
|
||||
# If that message is the quit string, close the connection and go back to waiting for a new client
|
||||
if first_word_block_after_handle == QUIT_STRING:
|
||||
self.client_connection.close()
|
||||
self.wait_for_client_flag = True
|
||||
print("Client closed connection!")
|
||||
else:
|
||||
# Otherwise, print the received data
|
||||
print(received_data)
|
||||
|
||||
# Then print your own handle, and read in a message to send to the client
|
||||
handle_prefix = self.handle + "> "
|
||||
print(handle_prefix, end="")
|
||||
keyboard_input = input()
|
||||
|
||||
# Send the message to the client
|
||||
self.client_connection.send(bytes(handle_prefix + keyboard_input, "utf-8"))
|
||||
|
||||
# Check the message sent, and if it's the quit message, disconnect from the client and wait for a new one
|
||||
if keyboard_input == QUIT_STRING:
|
||||
self.client_connection.close()
|
||||
self.wait_for_client_flag = True
|
||||
print("Closed connection with client!")
|
||||
|
||||
def on_program_should_exit(self):
|
||||
# This attempts to cleanly close the connection on ctrl-c
|
||||
try:
|
||||
self.client_connection.close()
|
||||
print("Closed connection for Ctrl-C exit...")
|
||||
except:
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Get the number of command line arguments
|
||||
num_args = len(sys.argv)
|
||||
|
||||
# If we at least have the minimum, process the arguments
|
||||
if num_args > 3:
|
||||
port_num = None
|
||||
handle = ""
|
||||
|
||||
# This for loop gets the port number and handle passed in via command line
|
||||
for arg_index, _ in enumerate(sys.argv):
|
||||
current_arg = sys.argv[arg_index]
|
||||
if current_arg == "-port":
|
||||
port_num = int(sys.argv[arg_index + 1])
|
||||
|
||||
elif current_arg == "-handle":
|
||||
handle = sys.argv[arg_index + 1]
|
||||
|
||||
# Now we do a quick check to make sure the port is valid
|
||||
if (port_num < PORT_MIN) or (port_num > PORT_MAX):
|
||||
print("Invalid port number. Please try again with a valid port! Exiting...")
|
||||
exit()
|
||||
|
||||
# We also check to make sure the handle is valid
|
||||
if handle == "":
|
||||
print("No handle given. Please try again with a valid handle! Exiting...")
|
||||
exit()
|
||||
|
||||
# Now we make an instance of the chat server with the correct arguments
|
||||
ChatServer(port_number=port_num, server_handle=handle)
|
||||
|
||||
else:
|
||||
print("Not enough arguments. Exiting...")
|
||||
print("usage: python3 chatserv.py -port [port_number] -handle \"[handle]\"")
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PublishConfigData" autoUpload="Always" serverName="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" autoUploadExternalChanges="true">
|
||||
<serverData>
|
||||
<paths name="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
<mapping deploy="/ftclient" local="$PROJECT_DIR$" />
|
||||
</mappings>
|
||||
</serverdata>
|
||||
</paths>
|
||||
</serverData>
|
||||
<option name="myAutoUpload" value="ALWAYS" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="useProjectProfile" value="false" />
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Remote Python 3.3.2 (ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/ftclient.iml" filepath="$PROJECT_DIR$/.idea/ftclient.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteMappingsManager">
|
||||
<list>
|
||||
<list>
|
||||
<remote-mappings server-id="python@ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" />
|
||||
</list>
|
||||
</list>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="WebServers">
|
||||
<option name="servers">
|
||||
<webServer id="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" name="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3">
|
||||
<fileTransfer host="flip2.engr.oregonstate.edu" port="22" rootFolder="/nfs/stak/students/p/perrenc" accessType="SFTP">
|
||||
<option name="port" value="22" />
|
||||
</fileTransfer>
|
||||
</webServer>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,522 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="cc3a9c44-366d-469b-bb3b-6440d7c0bdd5" name="Default" comment="" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="CoverageDataManager">
|
||||
<SUITE FILE_PATH="coverage/ftclient$Remote_33021__l_33022.coverage" NAME="Remote 33021 33022 -l Coverage Results" MODIFIED="1489301984401" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/ftclient$Remote_no_args.coverage" NAME="Remote no args Coverage Results" MODIFIED="1489297322152" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/ftclient$Remote_32021_32022__l.coverage" NAME="Remote 32021 32022 -l Coverage Results" MODIFIED="1489355116833" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/ftclient$Remote_33021_33022__l.coverage" NAME="Remote 33021 33022 -l Coverage Results" MODIFIED="1489367460072" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/ftclient$Remote_33021_33022__g_test_txt_.coverage" NAME="Remote 33021 33022 -g test.txt Coverage Results" MODIFIED="1489370448998" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/ftclient$Remote_33021_33022__g_test_none_txt.coverage" NAME="Remote 33021 33022 -g test_none.txt Coverage Results" MODIFIED="1489362146239" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
<SUITE FILE_PATH="coverage/ftclient$Remote_32021__l_32022.coverage" NAME="Remote 32021 32022 -l Coverage Results" MODIFIED="1489302023746" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="450">
|
||||
<file leaf-file-name="ftclient.py" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/ftclient.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="6650">
|
||||
<caret line="266" column="99" lean-forward="false" selection-start-line="266" selection-start-column="99" selection-end-line="266" selection-end-column="99" />
|
||||
<folding>
|
||||
<element signature="e#319#330#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Python Script" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>utf-8</find>
|
||||
<find>ascii</find>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace>ascii</replace>
|
||||
<replace>utf-8</replace>
|
||||
</replaceStrings>
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/ftclient.py" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsGulpfileManager">
|
||||
<detection-done>true</detection-done>
|
||||
<sorting>DEFINITION_ORDER</sorting>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="-11" />
|
||||
<option name="y" value="-11" />
|
||||
<option name="width" value="3862" />
|
||||
<option name="height" value="2136" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
<manualOrder />
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ftclient" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="ftclient" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scratches" />
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="nodejs_interpreter_path" value="C:/Program Files/nodejs/node" />
|
||||
<property name="js.eslint.eslintPackage" value="" />
|
||||
<property name="js-jscs-nodeInterpreter" value="C:\Program Files\nodejs\node.exe" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/ftclient.py" />
|
||||
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
|
||||
</component>
|
||||
<component name="RunManager" selected="Python.Remote 33021 33022 -g test.txt ">
|
||||
<configuration default="true" type="DjangoTestsConfigurationType" factoryName="Django tests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="TARGET" value="" />
|
||||
<option name="SETTINGS_FILE" value="" />
|
||||
<option name="CUSTOM_SETTINGS" value="false" />
|
||||
<option name="USE_OPTIONS" value="false" />
|
||||
<option name="OPTIONS" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
|
||||
<config-file value="" />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PyBehaveRunConfigurationType" factoryName="Behave">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="ADDITIONAL_ARGS" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PyLettuceRunConfigurationType" factoryName="Lettuce">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="ADDITIONAL_ARGS" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="Tox" factoryName="Tox">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<module name="ftclient" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
|
||||
<node-interpreter>project</node-interpreter>
|
||||
<node-options />
|
||||
<gulpfile />
|
||||
<tasks />
|
||||
<arguments />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
|
||||
<command value="run" />
|
||||
<scripts />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Attests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Doctests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Nosetests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="PARAMS" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="Unittests">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="PUREUNITTEST" value="true" />
|
||||
<option name="PARAMS" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="tests" factoryName="py.test">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="FOLDER_NAME" value="" />
|
||||
<option name="TEST_TYPE" value="TEST_SCRIPT" />
|
||||
<option name="PATTERN" value="" />
|
||||
<option name="USE_PATTERN" value="false" />
|
||||
<option name="testToRun" value="" />
|
||||
<option name="keywords" value="" />
|
||||
<option name="params" value="" />
|
||||
<option name="USE_PARAM" value="false" />
|
||||
<option name="USE_KEYWORD" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="Remote no args" type="PythonConfigurationType" factoryName="Python" singleton="true">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/ftclient.py" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="Remote 32021 32022 -l" type="PythonConfigurationType" factoryName="Python" singleton="true">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/ftclient.py" />
|
||||
<option name="PARAMETERS" value="localhost 32021 32022 -l" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="Remote 33021 33022 -l" type="PythonConfigurationType" factoryName="Python" singleton="true">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/ftclient.py" />
|
||||
<option name="PARAMETERS" value="localhost 33021 33022 -l" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="Remote 33021 33022 -g test.txt " type="PythonConfigurationType" factoryName="Python" singleton="true">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/ftclient.py" />
|
||||
<option name="PARAMETERS" value="localhost 33021 33022 -g ftserver" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="Remote 33021 33022 -g test_none.txt" type="PythonConfigurationType" factoryName="Python" singleton="true">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="ssh://perrenc@flip2.engr.oregonstate.edu:22/usr/bin/python3" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="ftclient" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/ftclient.py" />
|
||||
<option name="PARAMETERS" value="localhost 33021 33022 -g test_none.txt" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<method />
|
||||
</configuration>
|
||||
<list size="5">
|
||||
<item index="0" class="java.lang.String" itemvalue="Python.Remote no args" />
|
||||
<item index="1" class="java.lang.String" itemvalue="Python.Remote 32021 32022 -l" />
|
||||
<item index="2" class="java.lang.String" itemvalue="Python.Remote 33021 33022 -l" />
|
||||
<item index="3" class="java.lang.String" itemvalue="Python.Remote 33021 33022 -g test.txt " />
|
||||
<item index="4" class="java.lang.String" itemvalue="Python.Remote 33021 33022 -g test_none.txt" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="cc3a9c44-366d-469b-bb3b-6440d7c0bdd5" name="Default" comment="" />
|
||||
<created>1489274153004</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1489274153004</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-11" y="-11" width="3862" height="2136" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32990265" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.13626313" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3297402" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.104231164" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2200957" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3297402" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
<layout-to-restore>
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.13630041" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2200957" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
|
||||
</layout-to-restore>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="processedProjectFiles" value="true" />
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/ftclient.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#319#330#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/ftclient.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="6650">
|
||||
<caret line="266" column="99" lean-forward="false" selection-start-line="266" selection-start-column="99" selection-end-line="266" selection-end-column="99" />
|
||||
<folding>
|
||||
<element signature="e#319#330#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,272 @@
|
||||
#####################################
|
||||
# ftclient.py
|
||||
# Author: Corwin Perren
|
||||
# Created on March 11, 2017, 3:55 PM
|
||||
#
|
||||
# This file contains all of the code for the file transfer client application.
|
||||
#####################################
|
||||
|
||||
#####################################
|
||||
# Imports
|
||||
#####################################
|
||||
import time
|
||||
import socket
|
||||
import sys
|
||||
import signal
|
||||
import os.path
|
||||
|
||||
#####################################
|
||||
# Global Variables
|
||||
#####################################
|
||||
PORT_MIN = 1024
|
||||
PORT_MAX = 65535
|
||||
|
||||
USAGE_STRING = "usage: python3 chatserv.py [hostname] [control_port] [data_port] [command] or\n" + \
|
||||
"python3 chatserv.py [hostname] [control_port] [data_port] [command] [filename]"
|
||||
|
||||
VALID_YES_RESPONSES = ["", "Y", "y"]
|
||||
|
||||
|
||||
#####################################
|
||||
# FT Client Class Definition
|
||||
#####################################
|
||||
class FTClient:
|
||||
def __init__(self, hostname, control_port, command, data_port, filename=None):
|
||||
super(FTClient, self).__init__()
|
||||
|
||||
# ########## Thread Flags ##########
|
||||
self.run_flag = True
|
||||
self.check_input_flag = True
|
||||
self.setup_sockets_flag = True
|
||||
self.send_request_receive_data_flag = True
|
||||
|
||||
# ########## Class Variables ##########
|
||||
self.hostname = str(hostname)
|
||||
self.control_port = int(control_port)
|
||||
self.command = str(command)
|
||||
self.data_port = int(data_port)
|
||||
self.filename = str(filename)
|
||||
|
||||
self.control_socket = None # type: socket.socket
|
||||
self.data_socket = None # type: socket.socket
|
||||
self.receive_socket = None # type: socket.socket
|
||||
|
||||
# ########## Handle ctrl-c somewhat nicely ##########
|
||||
signal.signal(signal.SIGINT, self.on_exit)
|
||||
|
||||
# ########## Run the client ##########
|
||||
self.run()
|
||||
|
||||
def run(self):
|
||||
# ########## Main program run loop ##########
|
||||
while self.run_flag:
|
||||
if self.check_input_flag:
|
||||
self.check_input()
|
||||
self.check_input_flag = False
|
||||
if self.setup_sockets_flag:
|
||||
self.setup_sockets()
|
||||
self.setup_sockets_flag = False
|
||||
if self.send_request_receive_data_flag:
|
||||
self.send_request_receive_data()
|
||||
self.send_request_receive_data_flag = False
|
||||
self.run_flag = False
|
||||
time.sleep(0.1)
|
||||
|
||||
# ########## Final socket cleanup when program exits ##########
|
||||
self.on_exit()
|
||||
|
||||
def check_input(self):
|
||||
# ########## This method checks all inputs to make sure they've reasonably valid ##########
|
||||
|
||||
failure = False
|
||||
|
||||
if self.hostname == "":
|
||||
print("No hostname provided! Exiting!")
|
||||
failure = True
|
||||
|
||||
if self.control_port > PORT_MAX or self.control_port < PORT_MIN:
|
||||
print("Invalid control port! Exiting!")
|
||||
failure = True
|
||||
|
||||
if self.data_port > PORT_MAX or self.data_port < PORT_MIN:
|
||||
print("Invalid data port! Exiting!")
|
||||
failure = True
|
||||
|
||||
if failure:
|
||||
print(USAGE_STRING)
|
||||
self.run_flag = False
|
||||
|
||||
def setup_sockets(self):
|
||||
# ########## Print the program title ##########
|
||||
print("########################################")
|
||||
print(" Transfer Client - Version 1.0 ")
|
||||
print(" Written by Corwin Perren ")
|
||||
print("########################################")
|
||||
|
||||
# ########## Create and connect to the sever on the control port ##########
|
||||
self.control_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.control_socket.connect((self.hostname, self.control_port))
|
||||
|
||||
# ########## Setup and listen to the data socket for later ##########
|
||||
self.data_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.data_socket.bind((self.hostname, self.data_port))
|
||||
self.data_socket.listen(1)
|
||||
|
||||
def send_request_receive_data(self):
|
||||
# ########## Send the requested data port ##########
|
||||
print("Sending data port: " + str(self.data_port) + "\t\t", end="")
|
||||
self.control_socket.send(bytes(str(self.data_port), "utf-8"))
|
||||
self.wait_for_ok()
|
||||
|
||||
# ########## Send the command entered ##########
|
||||
print("Sending command: " + str(self.command) + "\t\t", end="")
|
||||
self.control_socket.send(bytes(str(self.command), "utf-8"))
|
||||
self.wait_for_ok()
|
||||
|
||||
# ########## If the user is getting a file, also send the filename to the server ##########
|
||||
if self.command == "-g":
|
||||
print("Sending filename: " + str(self.filename) + "\t\t", end="")
|
||||
self.control_socket.send(bytes(str(self.filename[:1024]), "utf-8"))
|
||||
self.wait_for_ok()
|
||||
|
||||
# ########## Based on the command, call pertinent methods ##########
|
||||
# ########## We also accept a connection from the server when needed ##########
|
||||
if self.command == "-l":
|
||||
self.receive_socket, _ = self.data_socket.accept()
|
||||
self.receive_listing()
|
||||
elif self.command == "-g":
|
||||
self.receive_socket, _ = self.data_socket.accept()
|
||||
self.receive_file()
|
||||
else:
|
||||
self.receive_error()
|
||||
|
||||
def receive_listing(self):
|
||||
full_string = ""
|
||||
temp = ""
|
||||
|
||||
# ########## Print out server data until an OK command is received, noting completion ##########
|
||||
while temp != "OK":
|
||||
full_string += temp
|
||||
temp = self.receive_socket.recv(1024).decode("utf-8").strip('\0')
|
||||
self.receive_socket.send(bytes("OK", "utf-8"))
|
||||
|
||||
print(full_string, end="")
|
||||
|
||||
def receive_file(self):
|
||||
# ########## Receive and print the header from the server ##########
|
||||
print(self.receive_socket.recv(1024).decode("utf-8").strip('\0'), end="")
|
||||
self.receive_socket.send(bytes("OK", "utf-8"))
|
||||
|
||||
# ########## Receive the size of the file in bytes ##########
|
||||
num_bytes = int(self.receive_socket.recv(1024).decode("utf-8").strip('\0'))
|
||||
self.receive_socket.send(bytes("OK", "utf-8"))
|
||||
|
||||
if num_bytes == 0:
|
||||
# ########## If zero bytes, the file doesn't exist. Print the error from the server. ##########
|
||||
print(self.receive_socket.recv(1024).decode("utf-8").strip('\0'), end="")
|
||||
self.receive_socket.send(bytes("OK", "utf-8"))
|
||||
else:
|
||||
# ########## File exists. Print the file size, and let the user know we're transferring. ##########
|
||||
print("File size: " + str(num_bytes) + " bytes.")
|
||||
print("Transferring file!")
|
||||
|
||||
should_transfer = True
|
||||
|
||||
# ########## Check if the file exists locally ##########
|
||||
if os.path.exists(self.filename):
|
||||
# ########## If it does, ask the user if we want to overwrite. ##########
|
||||
print("File \"" + self.filename + "\" already exists. Overwrite?")
|
||||
response = input("Y/n [Default Y]: ")
|
||||
|
||||
# ########## If we don't, set the pertinent flag and let the user know we heard them. ##########
|
||||
if response not in VALID_YES_RESPONSES:
|
||||
print("No selected, or invalid input. Stopping transfer.")
|
||||
should_transfer = False
|
||||
|
||||
# ########## In the case where we will perform a transfer ##########
|
||||
if should_transfer:
|
||||
# ########## Send okay to let the server know we're ready. ##########
|
||||
self.receive_socket.send(bytes("OK", "utf-8"))
|
||||
|
||||
# ########## Get a file pointer to the local file ##########
|
||||
file_pointer = open(self.filename, "wb")
|
||||
|
||||
# ########## Keep a running count of the number of bytes we've gotten. ##########
|
||||
bytes_received = 0
|
||||
|
||||
# ########## Keep receiving until we have the correct number of bytes for the file. ##########
|
||||
while bytes_received != num_bytes:
|
||||
# ########## Receive the data ##########
|
||||
temp = self.receive_socket.recv(1024)
|
||||
|
||||
# ########## Add the byte count to the number received. ##########
|
||||
bytes_received += len(temp)
|
||||
|
||||
# ########## Write the data to the file ##########
|
||||
file_pointer.write(temp)
|
||||
|
||||
# ########## Let the server know we're ready for the next block. ##########
|
||||
self.receive_socket.send(bytes("OK", "utf-8"))
|
||||
|
||||
# ########## Print the total number of bytes we have now. ##########
|
||||
print("Received " + str(bytes_received) + " bytes.")
|
||||
|
||||
# ########## Let the user know we're done transferring. ##########
|
||||
print("File transfer complete!")
|
||||
else:
|
||||
# ########## In the case where we don't want to overwrite a file, tell the server to exit. ##########
|
||||
self.receive_socket.send(bytes("EXIT", "utf-8"))
|
||||
|
||||
def receive_error(self):
|
||||
# ########## Print the server's error when an unknown command is received. ##########
|
||||
print(self.control_socket.recv(1024).decode("utf-8").strip('\0'), end="")
|
||||
self.control_socket.send(bytes("OK", "utf-8"))
|
||||
|
||||
def wait_for_ok(self):
|
||||
# ########## Wait for a response from the server, aka. a simple OK, not checking for the word OK ##########
|
||||
print(self.control_socket.recv(3).decode("utf-8"))
|
||||
|
||||
def on_exit(self, signum=None, frame=None):
|
||||
self.run_flag = False
|
||||
|
||||
# ########## Print a end title ##########
|
||||
print("########################################")
|
||||
print(" Program Complete ")
|
||||
print("########################################")
|
||||
|
||||
# ########## Attempt to cleanly close sockets if they exist ##########
|
||||
try:
|
||||
self.control_socket.close()
|
||||
print("Closed control socket...")
|
||||
except:
|
||||
print("No control socket open.")
|
||||
pass
|
||||
|
||||
try:
|
||||
self.data_socket.close()
|
||||
print("Closed data socket...")
|
||||
except:
|
||||
print("No data socket open.")
|
||||
pass
|
||||
|
||||
print("########################################")
|
||||
|
||||
#####################################
|
||||
# Main
|
||||
#####################################
|
||||
if __name__ == "__main__":
|
||||
# ########## Get the number of command line arguments ##########
|
||||
num_args = len(sys.argv)
|
||||
|
||||
# ########## If we don't have the right number of arguments, exit ##########
|
||||
if num_args < 5 or num_args > 6:
|
||||
print("Not enough arguments. Exiting...")
|
||||
print(USAGE_STRING)
|
||||
exit()
|
||||
|
||||
# ########## Make an instance of the file transfer client with the correct arguments ##########
|
||||
if num_args == 5:
|
||||
FTClient(hostname=sys.argv[1], control_port=sys.argv[2], data_port=sys.argv[3], command=sys.argv[4])
|
||||
elif num_args == 6:
|
||||
FTClient(hostname=sys.argv[1], control_port=sys.argv[2], data_port=sys.argv[3], command=sys.argv[4], filename=sys.argv[5])
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
CFLAGS = -g -Wall -fpic -lm -std=c99
|
||||
|
||||
default: all
|
||||
|
||||
all: ftserver.o
|
||||
gcc main.c ftserver.o -o ftserver $(CFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f ftserver.o ftserver
|
||||
|
||||
ftserver.o: ftserver.c
|
||||
gcc -c ftserver.c -o ftserver.o $(CFLAGS)
|
||||
@@ -0,0 +1,49 @@
|
||||
######### Project 2 #########
|
||||
######### CS 372 #########
|
||||
######### Written by Corwin Perren #########
|
||||
|
||||
##### Extra Credit #####
|
||||
This implementation allows for the transfer of ANY file, not just text files.
|
||||
It also should have no problems with both large and small files of both kinds.
|
||||
I personally tested it with the ftserver binary (26.3kB) and a 2MB text file.
|
||||
|
||||
|
||||
##### General Notes #####
|
||||
To the best of my knowledge, this meets all requirements for the assignment.
|
||||
As would be expected, the server must be started and running before the client.
|
||||
While running, the server will print out a startup title, minimal debug information,
|
||||
and nothing else.
|
||||
The client will print out a title, some debug information, and all required info
|
||||
from the assignment guidelines.
|
||||
Make sure that the control ports match between the server and client.
|
||||
|
||||
################################################################################
|
||||
|
||||
##### To compile the server #####
|
||||
In the same directory as Makefile, main.c, ftserver.c, and ftserver.h, run the following:
|
||||
|
||||
make clean all
|
||||
|
||||
This should result in an output binary in the same directory called "ftserver".
|
||||
|
||||
##### To run the server #####
|
||||
In the same directory as the newly compiled "ftserver" binary, run the following.
|
||||
|
||||
./ftserver [control_port]
|
||||
|
||||
an example could be:
|
||||
|
||||
./ftserver 33121
|
||||
|
||||
##### To run the client #####
|
||||
In the same directory as the file chatclient.py, run the following:
|
||||
|
||||
python3 ftclient.py [control_port] [data_port] [command] [filename] *filename optional*
|
||||
|
||||
## Example directory listing
|
||||
|
||||
python3 ftclient.py 33121 33122 -l
|
||||
|
||||
## Example file transfer
|
||||
|
||||
python3 ftclient.py 33121 33122 -g file.txt
|
||||
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
* File: ftserver.c
|
||||
* Author: Corwin Perren
|
||||
*
|
||||
* Created on March 11, 2017, 3:11 PM
|
||||
*
|
||||
* This file contains all the functions needed for the server.
|
||||
*/
|
||||
|
||||
#include "ftserver.h"
|
||||
|
||||
int get_listen_sfd(void){
|
||||
///// Create our listening socket, check if created successfully /////
|
||||
int listen_sfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(listen_sfd < 0){
|
||||
printf("Could not create listening socket! Exiting...\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
///// Return our new listening socket /////
|
||||
return listen_sfd;
|
||||
}
|
||||
|
||||
void setup_server_address_struct(struct sockaddr_in *server_address, int port){
|
||||
////// Setup the server struct with port and other info /////
|
||||
memset((char *)server_address, '\0', sizeof(*server_address));
|
||||
server_address->sin_port = htons(port);
|
||||
server_address->sin_addr.s_addr = INADDR_ANY;
|
||||
server_address->sin_family = AF_INET;
|
||||
}
|
||||
|
||||
void bind_listen_socket(int listen_sfd, struct sockaddr_in *server_address){
|
||||
///// Bind server socket /////
|
||||
int bind_result = bind(listen_sfd, (struct sockaddr *)server_address, sizeof(*server_address));
|
||||
if(bind_result < 0){
|
||||
fprintf(stderr, "Failed to bind listening port! "
|
||||
"Please choose a different port! Exiting...\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
void get_client_control_sfd_and_info(int listen_sfd, int *control_sfd, struct sockaddr_in *client_address){
|
||||
///// This accepts a new client when a request comes in, and sets the control socket file descriptor /////
|
||||
socklen_t client_length = sizeof(*client_address);
|
||||
*control_sfd = accept(listen_sfd, (struct sockaddr *) client_address, &client_length);
|
||||
}
|
||||
|
||||
int get_client_data_sfd_and_info(int port, struct sockaddr_in *control_address, struct sockaddr_in *data_address){
|
||||
///// Create a new socket for data /////
|
||||
int sfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(sfd < 0){
|
||||
printf("Could not create data socket! Exiting...\n");
|
||||
fflush(stdout);
|
||||
return -1;
|
||||
}
|
||||
|
||||
///// Set up the server parameters, specifically the port send in /////
|
||||
memset((char *)data_address, '\0', sizeof(*data_address));
|
||||
data_address->sin_port = htons(port);
|
||||
memcpy(&data_address->sin_addr, &control_address->sin_addr, sizeof(control_address->sin_addr));
|
||||
data_address->sin_family = AF_INET;
|
||||
|
||||
///// Make the connection and verify it didn't fail. /////
|
||||
int connect_result = connect(sfd, (struct sockaddr *)data_address, sizeof(*data_address));
|
||||
if(connect_result < 0){
|
||||
fprintf(stderr, "Connection failed! Is the port correct? Exiting...\n");
|
||||
fflush(stdout);
|
||||
return -1;
|
||||
}
|
||||
|
||||
///// Return our new data transfer socket file descriptor /////
|
||||
return sfd;
|
||||
}
|
||||
|
||||
|
||||
void send_file_listing(int control_sfd, int data_sfd){
|
||||
///// Variables /////
|
||||
DIR *dir;
|
||||
struct dirent *directory;
|
||||
struct stat s;
|
||||
|
||||
///// Open the current directory /////
|
||||
dir = opendir(".");
|
||||
|
||||
///// Make and write a header to the client /////
|
||||
char header[] = "########################################\n"
|
||||
" Directory Listing \n"
|
||||
"########################################\n";
|
||||
write(data_sfd, header, strlen(header));
|
||||
wait_for_ok(data_sfd);
|
||||
|
||||
///// Get ready to traverse directory /////
|
||||
int end_reached = 0;
|
||||
while(!end_reached){
|
||||
///// Get the next item in the directory /////
|
||||
directory = readdir(dir);
|
||||
|
||||
///// If it's NULL, we've reached the end, break out /////
|
||||
if(directory == NULL){
|
||||
end_reached = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
///// Get and send only files, no folders /////
|
||||
///// Core of getting only files was taken from the link below, modified ////
|
||||
///// to work on the flip servers with S_ISREG /////
|
||||
///// https://cboard.cprogramming.com/linux-programming/78236-list-files-directory-without-folders.html /////
|
||||
|
||||
///// Get information about the current item in the directory /////
|
||||
stat(directory->d_name, &s);
|
||||
|
||||
///// If it's a regular file, write it to the data socket /////
|
||||
if(S_ISREG(s.st_mode)){
|
||||
write(data_sfd, directory->d_name, strlen(directory->d_name));
|
||||
write(data_sfd, "\n", 2);
|
||||
wait_for_ok(data_sfd);
|
||||
}
|
||||
}
|
||||
///// Send a final OK to let the client know we're done /////
|
||||
write(data_sfd, "OK", 3);
|
||||
wait_for_ok(data_sfd);
|
||||
|
||||
}
|
||||
|
||||
void send_file_if_available(char *filename, int control_sfd, int data_sfd){
|
||||
///// Variables /////
|
||||
char buffer[1024];
|
||||
memset(buffer, '\0', 1024);
|
||||
long int file_size = 0;
|
||||
FILE *file_pointer;
|
||||
|
||||
///// Send the header /////
|
||||
char header[] = "########################################\n"
|
||||
" File Transfer \n"
|
||||
"########################################\n";
|
||||
write(data_sfd, header, strlen(header));
|
||||
wait_for_ok(data_sfd);
|
||||
|
||||
///// Open the file /////
|
||||
file_pointer = fopen(filename, "rb");
|
||||
|
||||
if(file_pointer != NULL){
|
||||
///// Seek to the end and get the file size, then rewind to the beginning /////
|
||||
fseek(file_pointer, 0L, SEEK_END);
|
||||
file_size = ftell(file_pointer);
|
||||
rewind(file_pointer);
|
||||
|
||||
///// Send the file size to the client /////
|
||||
sprintf(buffer, "%ld", file_size);
|
||||
write(data_sfd, buffer, strlen(buffer));
|
||||
wait_for_ok(data_sfd);
|
||||
|
||||
///// If the client wants the file (duplicate name handling), start the transfer /////
|
||||
if(should_transfer(data_sfd)){
|
||||
///// Get the nubmer of 1KB blocks, and remainder, so we can be efficient about transfer /////
|
||||
long int blocks = file_size / 1024;
|
||||
int remainder = file_size % 1024;
|
||||
|
||||
///// Read 1KB block as needed and send to client/////
|
||||
for(long int i = 0 ; i < blocks ; i++){
|
||||
fread(buffer, sizeof(buffer), 1, file_pointer); //Reads one 1024 byte block
|
||||
write(data_sfd, buffer, 1024);
|
||||
wait_for_ok(data_sfd);
|
||||
}
|
||||
|
||||
///// If the file isn't a multiple of 1KB, send the remainder /////
|
||||
if(remainder > 0){
|
||||
fread(buffer, remainder, 1, file_pointer); //Reads one remainder byte block
|
||||
write(data_sfd, buffer, remainder);
|
||||
wait_for_ok(data_sfd);
|
||||
}
|
||||
|
||||
///// Close the file /////
|
||||
fclose(file_pointer);
|
||||
}
|
||||
|
||||
}else{
|
||||
///// The requested file doesn't exist. Let the client know. /////
|
||||
write(data_sfd, "0", 2);
|
||||
wait_for_ok(data_sfd);
|
||||
|
||||
char no_file_message[] = "File not found!\n";
|
||||
write(data_sfd, no_file_message, strlen(no_file_message));
|
||||
wait_for_ok(data_sfd);
|
||||
}
|
||||
}
|
||||
|
||||
void send_unknown_command_received(int sfd){
|
||||
///// Send the header, so the client knows it's invalid. /////
|
||||
char header[] = "########################################\n"
|
||||
" UNKNOWN COMMAND \n"
|
||||
"########################################\n"
|
||||
"Please double check your command.\n";
|
||||
write(sfd, header, strlen(header));
|
||||
wait_for_ok(sfd);
|
||||
}
|
||||
|
||||
void wait_for_ok(int sfd){
|
||||
///// This reads from the sfd until an OK response is received /////
|
||||
char read_buffer[1024];
|
||||
memset(read_buffer, '\0', 1024);
|
||||
|
||||
while(strcmp(read_buffer, "OK") != 0){
|
||||
memset(read_buffer, '\0', 1024);
|
||||
read(sfd, read_buffer, 1023);
|
||||
}
|
||||
}
|
||||
|
||||
int should_transfer(int sfd){
|
||||
///// This reads an OK or EXIT from the client to determine if a transfer should occur. /////
|
||||
///// EXIT will happen if the file is already at the destination and the client does not want to overwrite. /////
|
||||
char read_buffer[1024];
|
||||
memset(read_buffer, '\0', 1024);
|
||||
read(sfd, read_buffer, 1023);
|
||||
|
||||
if(strcmp(read_buffer, "OK") == 0){
|
||||
return 1;
|
||||
}else if(strcmp(read_buffer, "EXIT") == 0){
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* File: ftserver.h
|
||||
* Author: Corwin Perren
|
||||
*
|
||||
* Created on March 11, 2017, 3:11 PM
|
||||
*
|
||||
* This file contains all the header information for ftserver.c
|
||||
*/
|
||||
|
||||
#ifndef FTSERVER_H
|
||||
#define FTSERVER_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define LOCAL_IP 127.0.0.1
|
||||
#define PORT_MIN 1024
|
||||
#define PORT_MAX 65535
|
||||
|
||||
int get_listen_sfd(void);
|
||||
void setup_server_address_struct(struct sockaddr_in *server_address, int port);
|
||||
void bind_listen_socket(int listen_sfd, struct sockaddr_in *server_address);
|
||||
|
||||
void get_client_control_sfd_and_info(int listen_sfd, int *control_sfd, struct sockaddr_in *client_address);
|
||||
int get_client_data_sfd_and_info(int port, struct sockaddr_in *control_address, struct sockaddr_in *data_address);
|
||||
|
||||
void send_file_listing(int control_sfd, int data_sfd);
|
||||
void send_file_if_available(char *filename, int control_sfd, int data_sfd);
|
||||
void send_unknown_command_received(int sfd);
|
||||
|
||||
void wait_for_ok(int sfd);
|
||||
int should_transfer(int sfd);
|
||||
|
||||
#endif /* FTSERVER_H */
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* File: main.c
|
||||
* Author: Corwin Perren
|
||||
*
|
||||
* Created on March 11, 2017, 3:11 PM
|
||||
*
|
||||
* This file contains the main function for the ftserver application.
|
||||
*
|
||||
* ***NOTE***
|
||||
* This implementation allows for the transfer of ANY file type, including
|
||||
* binary files.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "ftserver.h"
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
///// Variables /////
|
||||
int listen_sfd = -1; //sfd == socked_file_descriptor
|
||||
int control_sfd = -1;
|
||||
int data_sfd = -1;
|
||||
unsigned long int listen_port_number = 0; //0 - 65535
|
||||
|
||||
struct sockaddr_in server_address;
|
||||
struct sockaddr_in client_address_control;
|
||||
struct sockaddr_in client_address_data;
|
||||
|
||||
///// Verify number of command line arguments /////
|
||||
if(argc != 2){
|
||||
printf("Incorrect number of arguments. Exiting...\n");
|
||||
printf("usage: ftserver [port_number]\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
///// Verify port number is valid /////
|
||||
listen_port_number = atoi(argv[1]);
|
||||
if((listen_port_number > PORT_MAX) || (listen_port_number < PORT_MIN)){
|
||||
fprintf(stderr, "Port out of range! Please choose a different port! "
|
||||
"Exiting...\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
///// Print program title /////
|
||||
printf("########################################\n");
|
||||
printf(" Transfer Server - Version 1.0 \n");
|
||||
printf(" Written by Corwin Perren \n");
|
||||
printf("########################################\n");
|
||||
|
||||
///// Get, setup, and bind listening socket /////
|
||||
listen_sfd = get_listen_sfd();
|
||||
setup_server_address_struct(&server_address, listen_port_number);
|
||||
bind_listen_socket(listen_sfd, &server_address);
|
||||
|
||||
///// Main program loop /////
|
||||
while(1){
|
||||
///// Variables /////
|
||||
int data_port;
|
||||
char control_read_buffer[1024];
|
||||
char command[3];
|
||||
char filename[1024];
|
||||
|
||||
///// Listen for new connection on socket /////
|
||||
listen(listen_sfd, 1);
|
||||
|
||||
///// Accept a client, get its socket file descriptor /////
|
||||
get_client_control_sfd_and_info(listen_sfd, &control_sfd, &client_address_control);
|
||||
|
||||
///// Verify we connected properly /////
|
||||
if(control_sfd < 0){
|
||||
fprintf(stderr, "Client accept failed. Trying next "
|
||||
"connection...\n");
|
||||
}else{
|
||||
///// Let the server debug know we have a connection /////
|
||||
printf("Client connected!\n");
|
||||
|
||||
///// Read the data port into the buffer, convert to int /////
|
||||
memset(control_read_buffer, '\0', 1024);
|
||||
read(control_sfd, control_read_buffer, 1024);
|
||||
data_port = atoi(control_read_buffer);
|
||||
printf("PORT: %d\n", data_port);
|
||||
write(control_sfd, "OK", 3);
|
||||
|
||||
///// Read the command into the buffer /////
|
||||
memset(control_read_buffer, '\0', 1024);
|
||||
memset(command, '\0', 3);
|
||||
read(control_sfd, control_read_buffer, 1024);
|
||||
strncpy(command, control_read_buffer, 2);
|
||||
printf("Command: %s\n", command);
|
||||
write(control_sfd, "OK", 3);
|
||||
|
||||
///// If this is a get request, read the filename into the buffer /////
|
||||
if(strcmp(control_read_buffer, "-g") == 0){
|
||||
memset(control_read_buffer, '\0', 1024);
|
||||
memset(filename, '\0', 1024);
|
||||
read(control_sfd, control_read_buffer, 1024);
|
||||
strncpy(filename, control_read_buffer, 1023);
|
||||
printf("Filename: %s\n\n", filename);
|
||||
write(control_sfd, "OK", 3);
|
||||
}
|
||||
|
||||
///// Setup the data connection to the client /////
|
||||
data_sfd = get_client_data_sfd_and_info(data_port, &client_address_control, &client_address_data);
|
||||
|
||||
///// Process the command accordingly /////
|
||||
if(strcmp(command, "-l") == 0){
|
||||
send_file_listing(control_sfd, data_sfd);
|
||||
}else if(strcmp(command, "-g") == 0){
|
||||
send_file_if_available(filename, control_sfd, data_sfd);
|
||||
}else{
|
||||
send_unknown_command_received(control_sfd);
|
||||
}
|
||||
|
||||
printf("Client disconnected.\n");
|
||||
///// Close the sockets /////
|
||||
close(control_sfd);
|
||||
close(data_sfd);
|
||||
}
|
||||
}
|
||||
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="100">
|
||||
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
|
||||
<df root="." name="0">
|
||||
<in>README.txt</in>
|
||||
<in>ftserver.c</in>
|
||||
<in>main.c</in>
|
||||
<in>test.txt</in>
|
||||
</df>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
projectFiles="false"
|
||||
kind="IMPORTANT_FILES_FOLDER">
|
||||
<itemPath>Makefile</itemPath>
|
||||
<itemPath>nbproject/private/launcher.properties</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceFolderFilter>^(nbproject)$</sourceFolderFilter>
|
||||
<sourceRootList>
|
||||
<Elem>.</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="Remote_no_args" type="0">
|
||||
<toolsSet>
|
||||
<compilerSet>default</compilerSet>
|
||||
<dependencyChecking>false</dependencyChecking>
|
||||
<rebuildPropChanged>false</rebuildPropChanged>
|
||||
</toolsSet>
|
||||
<flagsDictionary>
|
||||
<element flagsID="0" commonFlags="-fpic -std=c99"/>
|
||||
</flagsDictionary>
|
||||
<codeAssistance>
|
||||
</codeAssistance>
|
||||
<makefileType>
|
||||
<makeTool>
|
||||
<buildCommandWorkingDir>.</buildCommandWorkingDir>
|
||||
<buildCommand>${MAKE} -f Makefile</buildCommand>
|
||||
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
|
||||
<executablePath>ftserver</executablePath>
|
||||
<cTool>
|
||||
<incDir>
|
||||
<pElem></pElem>
|
||||
</incDir>
|
||||
</cTool>
|
||||
</makeTool>
|
||||
<preBuild>
|
||||
<preBuildCommandWorkingDir>.</preBuildCommandWorkingDir>
|
||||
<preBuildCommand></preBuildCommand>
|
||||
</preBuild>
|
||||
</makefileType>
|
||||
<item path="README.txt" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
<item path="ftserver.c" ex="false" tool="0" flavor2="3">
|
||||
<cTool flags="0">
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="main.c" ex="false" tool="0" flavor2="2">
|
||||
</item>
|
||||
<item path="test.txt" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
<conf name="Remote_32021" type="0">
|
||||
<toolsSet>
|
||||
<compilerSet>default</compilerSet>
|
||||
<dependencyChecking>false</dependencyChecking>
|
||||
<rebuildPropChanged>false</rebuildPropChanged>
|
||||
</toolsSet>
|
||||
<flagsDictionary>
|
||||
<element flagsID="0" commonFlags="-fpic -std=c99"/>
|
||||
</flagsDictionary>
|
||||
<codeAssistance>
|
||||
</codeAssistance>
|
||||
<makefileType>
|
||||
<makeTool>
|
||||
<buildCommandWorkingDir>.</buildCommandWorkingDir>
|
||||
<buildCommand>${MAKE} -f Makefile</buildCommand>
|
||||
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
|
||||
<executablePath>ftserver</executablePath>
|
||||
<cTool>
|
||||
<incDir>
|
||||
<pElem></pElem>
|
||||
</incDir>
|
||||
</cTool>
|
||||
</makeTool>
|
||||
<preBuild>
|
||||
<preBuildCommandWorkingDir>.</preBuildCommandWorkingDir>
|
||||
<preBuildCommand></preBuildCommand>
|
||||
</preBuild>
|
||||
</makefileType>
|
||||
<item path="README.txt" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
<item path="ftserver.c" ex="false" tool="0" flavor2="3">
|
||||
<cTool flags="0">
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="main.c" ex="false" tool="0" flavor2="2">
|
||||
</item>
|
||||
<item path="test.txt" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
<conf name="Remote_33021" type="0">
|
||||
<toolsSet>
|
||||
<compilerSet>default</compilerSet>
|
||||
<dependencyChecking>false</dependencyChecking>
|
||||
<rebuildPropChanged>false</rebuildPropChanged>
|
||||
</toolsSet>
|
||||
<flagsDictionary>
|
||||
<element flagsID="0" commonFlags="-fpic -std=c99"/>
|
||||
</flagsDictionary>
|
||||
<codeAssistance>
|
||||
</codeAssistance>
|
||||
<makefileType>
|
||||
<makeTool>
|
||||
<buildCommandWorkingDir>.</buildCommandWorkingDir>
|
||||
<buildCommand>${MAKE} -f Makefile</buildCommand>
|
||||
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
|
||||
<executablePath>ftserver</executablePath>
|
||||
<cTool>
|
||||
<incDir>
|
||||
<pElem></pElem>
|
||||
</incDir>
|
||||
</cTool>
|
||||
</makeTool>
|
||||
<preBuild>
|
||||
<preBuildCommandWorkingDir>.</preBuildCommandWorkingDir>
|
||||
<preBuildCommand></preBuildCommand>
|
||||
</preBuild>
|
||||
</makefileType>
|
||||
<item path="README.txt" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
<item path="ftserver.c" ex="false" tool="0" flavor2="3">
|
||||
<cTool flags="0">
|
||||
</cTool>
|
||||
</item>
|
||||
<item path="main.c" ex="false" tool="0" flavor2="2">
|
||||
</item>
|
||||
<item path="test.txt" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
||||
@@ -0,0 +1 @@
|
||||
# Automatic path mapper. CRC = 1
|
||||
@@ -0,0 +1 @@
|
||||
gmake: *** No targets. Stop.
|
||||
@@ -0,0 +1 @@
|
||||
C:/Users/Corwin Perren/Documents/GitHub/CS372/Project 2/ftserver/ftserver.c=C:/Users/Corwin Perren/Documents/GitHub/CS372/Project 2/ftserver#-Wall -fpic -lm -std=c99 -c ftserver.c ftserver.h
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
*
|
||||
* Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
|
||||
* Other names may be trademarks of their respective owners.
|
||||
*
|
||||
* The contents of this file are subject to the terms of either the GNU
|
||||
* General Public License Version 2 only ("GPL") or the Common
|
||||
* Development and Distribution License("CDDL") (collectively, the
|
||||
* "License"). You may not use this file except in compliance with the
|
||||
* License. You can obtain a copy of the License at
|
||||
* http://www.netbeans.org/cddl-gplv2.html
|
||||
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
||||
* specific language governing permissions and limitations under the
|
||||
* License. When distributing the software, include this License Header
|
||||
* Notice in each file and include the License file at
|
||||
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the GPL Version 2 section of the License file that
|
||||
* accompanied this code. If applicable, add the following below the
|
||||
* License Header, with the fields enclosed by brackets [] replaced by
|
||||
* your own identifying information:
|
||||
* "Portions Copyrighted [year] [name of copyright owner]"
|
||||
*
|
||||
* If you wish your version of this file to be governed by only the CDDL
|
||||
* or only the GPL Version 2, indicate your decision by adding
|
||||
* "[Contributor] elects to include this software in this distribution
|
||||
* under the [CDDL or GPL Version 2] license." If you do not indicate a
|
||||
* single choice of license, a recipient has the option to distribute
|
||||
* your version of this file under either the CDDL, the GPL Version 2 or
|
||||
* to extend the choice of license to its licensees as provided above.
|
||||
* However, if you add GPL Version 2 code and therefore, elected the GPL
|
||||
* Version 2 license, then the option applies only if the new code is
|
||||
* made subject to such option by the copyright holder.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
// List of standard headers was taken in http://en.cppreference.com/w/c/header
|
||||
|
||||
#include <assert.h> // Conditionally compiled macro that compares its argument to zero
|
||||
#include <ctype.h> // Functions to determine the type contained in character data
|
||||
#include <errno.h> // Macros reporting error conditions
|
||||
#include <float.h> // Limits of float types
|
||||
#include <limits.h> // Sizes of basic types
|
||||
#include <locale.h> // Localization utilities
|
||||
#include <math.h> // Common mathematics functions
|
||||
#include <setjmp.h> // Nonlocal jumps
|
||||
#include <signal.h> // Signal handling
|
||||
#include <stdarg.h> // Variable arguments
|
||||
#include <stddef.h> // Common macro definitions
|
||||
#include <stdio.h> // Input/output
|
||||
#include <string.h> // String handling
|
||||
#include <stdlib.h> // General utilities: memory management, program utilities, string conversions, random numbers
|
||||
#include <time.h> // Time/date utilities
|
||||
#include <iso646.h> // (since C95) Alternative operator spellings
|
||||
#include <wchar.h> // (since C95) Extended multibyte and wide character utilities
|
||||
#include <wctype.h> // (since C95) Wide character classification and mapping utilities
|
||||
#ifdef _STDC_C99
|
||||
#include <complex.h> // (since C99) Complex number arithmetic
|
||||
#include <fenv.h> // (since C99) Floating-point environment
|
||||
#include <inttypes.h> // (since C99) Format conversion of integer types
|
||||
#include <stdbool.h> // (since C99) Boolean type
|
||||
#include <stdint.h> // (since C99) Fixed-width integer types
|
||||
#include <tgmath.h> // (since C99) Type-generic math (macros wrapping math.h and complex.h)
|
||||
#endif
|
||||
#ifdef _STDC_C11
|
||||
#include <stdalign.h> // (since C11) alignas and alignof convenience macros
|
||||
#include <stdatomic.h> // (since C11) Atomic types
|
||||
#include <stdnoreturn.h> // (since C11) noreturn convenience macros
|
||||
#include <threads.h> // (since C11) Thread library
|
||||
#include <uchar.h> // (since C11) UTF-16 and UTF-32 character utilities
|
||||
#endif
|
||||
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="100">
|
||||
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
|
||||
<df root="." name="0">
|
||||
<in>README.txt</in>
|
||||
<in>ftserver.c</in>
|
||||
<in>ftserver.h</in>
|
||||
<in>main.c</in>
|
||||
<in>test.txt</in>
|
||||
</df>
|
||||
</logicalFolder>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="Remote_no_args" type="0">
|
||||
<toolsSet>
|
||||
<developmentServer>perrenc@flip2.engr.oregonstate.edu:22</developmentServer>
|
||||
<platform>2</platform>
|
||||
</toolsSet>
|
||||
<compile>
|
||||
<compiledirpicklist>
|
||||
<compiledirpicklistitem>.</compiledirpicklistitem>
|
||||
<compiledirpicklistitem>${AUTO_FOLDER}</compiledirpicklistitem>
|
||||
</compiledirpicklist>
|
||||
<compiledir>${AUTO_FOLDER}</compiledir>
|
||||
<compilecommandpicklist>
|
||||
<compilecommandpicklistitem>${MAKE} ${ITEM_NAME}.o</compilecommandpicklistitem>
|
||||
<compilecommandpicklistitem>${AUTO_COMPILE}</compilecommandpicklistitem>
|
||||
</compilecommandpicklist>
|
||||
<compilecommand>${AUTO_COMPILE}</compilecommand>
|
||||
</compile>
|
||||
<dbx_gdbdebugger version="1">
|
||||
<gdb_pathmaps>
|
||||
</gdb_pathmaps>
|
||||
<gdb_interceptlist>
|
||||
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
|
||||
</gdb_interceptlist>
|
||||
<gdb_options>
|
||||
<DebugOptions>
|
||||
</DebugOptions>
|
||||
</gdb_options>
|
||||
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
|
||||
</dbx_gdbdebugger>
|
||||
<nativedebugger version="1">
|
||||
<engine>gdb</engine>
|
||||
</nativedebugger>
|
||||
<runprofile version="9">
|
||||
<runcommandpicklist>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}" 32021</runcommandpicklistitem>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
|
||||
</runcommandpicklist>
|
||||
<runcommand>"${OUTPUT_PATH}"</runcommand>
|
||||
<rundir>.</rundir>
|
||||
<buildfirst>true</buildfirst>
|
||||
<terminal-type>0</terminal-type>
|
||||
<remove-instrumentation>0</remove-instrumentation>
|
||||
<environment>
|
||||
</environment>
|
||||
</runprofile>
|
||||
</conf>
|
||||
<conf name="Remote_32021" type="0">
|
||||
<toolsSet>
|
||||
<developmentServer>perrenc@flip2.engr.oregonstate.edu:22</developmentServer>
|
||||
<platform>2</platform>
|
||||
</toolsSet>
|
||||
<compile>
|
||||
<compiledirpicklist>
|
||||
<compiledirpicklistitem>.</compiledirpicklistitem>
|
||||
<compiledirpicklistitem>${AUTO_FOLDER}</compiledirpicklistitem>
|
||||
</compiledirpicklist>
|
||||
<compiledir>${AUTO_FOLDER}</compiledir>
|
||||
<compilecommandpicklist>
|
||||
<compilecommandpicklistitem>${MAKE} ${ITEM_NAME}.o</compilecommandpicklistitem>
|
||||
<compilecommandpicklistitem>${AUTO_COMPILE}</compilecommandpicklistitem>
|
||||
</compilecommandpicklist>
|
||||
<compilecommand>${AUTO_COMPILE}</compilecommand>
|
||||
</compile>
|
||||
<dbx_gdbdebugger version="1">
|
||||
<gdb_pathmaps>
|
||||
</gdb_pathmaps>
|
||||
<gdb_interceptlist>
|
||||
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
|
||||
</gdb_interceptlist>
|
||||
<gdb_options>
|
||||
<DebugOptions>
|
||||
</DebugOptions>
|
||||
</gdb_options>
|
||||
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
|
||||
</dbx_gdbdebugger>
|
||||
<nativedebugger version="1">
|
||||
<engine>gdb</engine>
|
||||
</nativedebugger>
|
||||
<runprofile version="9">
|
||||
<runcommandpicklist>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}" 32021</runcommandpicklistitem>
|
||||
</runcommandpicklist>
|
||||
<runcommand>"${OUTPUT_PATH}" 32021</runcommand>
|
||||
<rundir>.</rundir>
|
||||
<buildfirst>true</buildfirst>
|
||||
<terminal-type>0</terminal-type>
|
||||
<remove-instrumentation>0</remove-instrumentation>
|
||||
<environment>
|
||||
</environment>
|
||||
</runprofile>
|
||||
</conf>
|
||||
<conf name="Remote_33021" type="0">
|
||||
<toolsSet>
|
||||
<developmentServer>perrenc@flip2.engr.oregonstate.edu:22</developmentServer>
|
||||
<platform>2</platform>
|
||||
</toolsSet>
|
||||
<compile>
|
||||
<compiledirpicklist>
|
||||
<compiledirpicklistitem>.</compiledirpicklistitem>
|
||||
<compiledirpicklistitem>${AUTO_FOLDER}</compiledirpicklistitem>
|
||||
</compiledirpicklist>
|
||||
<compiledir>${AUTO_FOLDER}</compiledir>
|
||||
<compilecommandpicklist>
|
||||
<compilecommandpicklistitem>${MAKE} ${ITEM_NAME}.o</compilecommandpicklistitem>
|
||||
<compilecommandpicklistitem>${AUTO_COMPILE}</compilecommandpicklistitem>
|
||||
</compilecommandpicklist>
|
||||
<compilecommand>${AUTO_COMPILE}</compilecommand>
|
||||
</compile>
|
||||
<dbx_gdbdebugger version="1">
|
||||
<gdb_pathmaps>
|
||||
</gdb_pathmaps>
|
||||
<gdb_interceptlist>
|
||||
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
|
||||
</gdb_interceptlist>
|
||||
<gdb_options>
|
||||
<DebugOptions>
|
||||
</DebugOptions>
|
||||
</gdb_options>
|
||||
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
|
||||
</dbx_gdbdebugger>
|
||||
<nativedebugger version="1">
|
||||
<engine>gdb</engine>
|
||||
</nativedebugger>
|
||||
<runprofile version="9">
|
||||
<runcommandpicklist>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}" 32021</runcommandpicklistitem>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}" 32064</runcommandpicklistitem>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}" 33021</runcommandpicklistitem>
|
||||
</runcommandpicklist>
|
||||
<runcommand>"${OUTPUT_PATH}" 33021</runcommand>
|
||||
<rundir>.</rundir>
|
||||
<buildfirst>true</buildfirst>
|
||||
<terminal-type>0</terminal-type>
|
||||
<remove-instrumentation>0</remove-instrumentation>
|
||||
<environment>
|
||||
</environment>
|
||||
</runprofile>
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
*
|
||||
* Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
|
||||
* Other names may be trademarks of their respective owners.
|
||||
*
|
||||
* The contents of this file are subject to the terms of either the GNU
|
||||
* General Public License Version 2 only ("GPL") or the Common
|
||||
* Development and Distribution License("CDDL") (collectively, the
|
||||
* "License"). You may not use this file except in compliance with the
|
||||
* License. You can obtain a copy of the License at
|
||||
* http://www.netbeans.org/cddl-gplv2.html
|
||||
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
||||
* specific language governing permissions and limitations under the
|
||||
* License. When distributing the software, include this License Header
|
||||
* Notice in each file and include the License file at
|
||||
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the GPL Version 2 section of the License file that
|
||||
* accompanied this code. If applicable, add the following below the
|
||||
* License Header, with the fields enclosed by brackets [] replaced by
|
||||
* your own identifying information:
|
||||
* "Portions Copyrighted [year] [name of copyright owner]"
|
||||
*
|
||||
* If you wish your version of this file to be governed by only the CDDL
|
||||
* or only the GPL Version 2, indicate your decision by adding
|
||||
* "[Contributor] elects to include this software in this distribution
|
||||
* under the [CDDL or GPL Version 2] license." If you do not indicate a
|
||||
* single choice of license, a recipient has the option to distribute
|
||||
* your version of this file under either the CDDL, the GPL Version 2 or
|
||||
* to extend the choice of license to its licensees as provided above.
|
||||
* However, if you add GPL Version 2 code and therefore, elected the GPL
|
||||
* Version 2 license, then the option applies only if the new code is
|
||||
* made subject to such option by the copyright holder.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
// List of standard headers was taken in http://en.cppreference.com/w/cpp/header
|
||||
|
||||
#include <cstdlib> // General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search
|
||||
#include <csignal> // Functions and macro constants for signal management
|
||||
#include <csetjmp> // Macro (and function) that saves (and jumps) to an execution context
|
||||
#include <cstdarg> // Handling of variable length argument lists
|
||||
#include <typeinfo> // Runtime type information utilities
|
||||
#include <bitset> // std::bitset class template
|
||||
#include <functional> // Function objects, designed for use with the standard algorithms
|
||||
#include <utility> // Various utility components
|
||||
#include <ctime> // C-style time/date utilites
|
||||
#include <cstddef> // typedefs for types such as size_t, NULL and others
|
||||
#include <new> // Low-level memory management utilities
|
||||
#include <memory> // Higher level memory management utilities
|
||||
#include <climits> // limits of integral types
|
||||
#include <cfloat> // limits of float types
|
||||
#include <limits> // standardized way to query properties of arithmetic types
|
||||
#include <exception> // Exception handling utilities
|
||||
#include <stdexcept> // Standard exception objects
|
||||
#include <cassert> // Conditionally compiled macro that compares its argument to zero
|
||||
#include <cerrno> // Macro containing the last error number
|
||||
#include <cctype> // functions to determine the type contained in character data
|
||||
#include <cwctype> // functions for determining the type of wide character data
|
||||
#include <cstring> // various narrow character string handling functions
|
||||
#include <cwchar> // various wide and multibyte string handling functions
|
||||
#include <string> // std::basic_string class template
|
||||
#include <vector> // std::vector container
|
||||
#include <deque> // std::deque container
|
||||
#include <list> // std::list container
|
||||
#include <set> // std::set and std::multiset associative containers
|
||||
#include <map> // std::map and std::multimap associative containers
|
||||
#include <stack> // std::stack container adaptor
|
||||
#include <queue> // std::queue and std::priority_queue container adaptors
|
||||
#include <algorithm> // Algorithms that operate on containers
|
||||
#include <iterator> // Container iterators
|
||||
#include <cmath> // Common mathematics functions
|
||||
#include <complex> // Complex number type
|
||||
#include <valarray> // Class for representing and manipulating arrays of values
|
||||
#include <numeric> // Numeric operations on values in containers
|
||||
#include <iosfwd> // forward declarations of all classes in the input/output library
|
||||
#include <ios> // std::ios_base class, std::basic_ios class template and several typedefs
|
||||
#include <istream> // std::basic_istream class template and several typedefs
|
||||
#include <ostream> // std::basic_ostream, std::basic_iostream class templates and several typedefs
|
||||
#include <iostream> // several standard stream objects
|
||||
#include <fstream> // std::basic_fstream, std::basic_ifstream, std::basic_ofstream class templates and several typedefs
|
||||
#include <sstream> // std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream class templates and several typedefs
|
||||
#include <strstream> // std::strstream, std::istrstream, std::ostrstream(deprecated)
|
||||
#include <iomanip> // Helper functions to control the format or input and output
|
||||
#include <streambuf> // std::basic_streambuf class template
|
||||
#include <cstdio> // C-style input-output functions
|
||||
#include <locale> // Localization utilities
|
||||
#include <clocale> // C localization utilities
|
||||
#include <ciso646> // empty header. The macros that appear in iso646.h in C are keywords in C++
|
||||
#if __cplusplus >= 201103L
|
||||
#include <typeindex> // (since C++11) std::type_index
|
||||
#include <type_traits> // (since C++11) Compile-time type information
|
||||
#include <chrono> // (since C++11) C++ time utilites
|
||||
#include <initializer_list> // (since C++11) std::initializer_list class template
|
||||
#include <tuple> // (since C++11) std::tuple class template
|
||||
#include <scoped_allocator> // (since C++11) Nested allocator class
|
||||
#include <cstdint> // (since C++11) fixed-size types and limits of other types
|
||||
#include <cinttypes> // (since C++11) formatting macros , intmax_t and uintmax_t math and conversions
|
||||
#include <system_error> // (since C++11) defines std::error_code, a platform-dependent error code
|
||||
#include <cuchar> // (since C++11) C-style Unicode character conversion functions
|
||||
#include <array> // (since C++11) std::array container
|
||||
#include <forward_list> // (since C++11) std::forward_list container
|
||||
#include <unordered_set> // (since C++11) std::unordered_set and std::unordered_multiset unordered associative containers
|
||||
#include <unordered_map> // (since C++11) std::unordered_map and std::unordered_multimap unordered associative containers
|
||||
#include <random> // (since C++11) Random number generators and distributions
|
||||
#include <ratio> // (since C++11) Compile-time rational arithmetic
|
||||
#include <cfenv> // (since C++11) Floating-point environment access functions
|
||||
#include <codecvt> // (since C++11) Unicode conversion facilities
|
||||
#include <regex> // (since C++11) Classes, algorithms and iterators to support regular expression processing
|
||||
#include <atomic> // (since C++11) Atomic operations library
|
||||
#include <ccomplex> // (since C++11)(deprecated in C++17) simply includes the header <complex>
|
||||
#include <ctgmath> // (since C++11)(deprecated in C++17) simply includes the headers <ccomplex> (until C++17)<complex> (since C++17) and <cmath>: the overloads equivalent to the contents of the C header tgmath.h are already provided by those headers
|
||||
#include <cstdalign> // (since C++11)(deprecated in C++17) defines one compatibility macro constant
|
||||
#include <cstdbool> // (since C++11)(deprecated in C++17) defines one compatibility macro constant
|
||||
#include <thread> // (since C++11) std::thread class and supporting functions
|
||||
#include <mutex> // (since C++11) mutual exclusion primitives
|
||||
#include <future> // (since C++11) primitives for asynchronous computations
|
||||
#include <condition_variable> // (since C++11) thread waiting conditions
|
||||
#endif
|
||||
#if __cplusplus >= 201300L
|
||||
#include <shared_mutex> // (since C++14) shared mutual exclusion primitives
|
||||
#endif
|
||||
#if __cplusplus >= 201500L
|
||||
#include <any> // (since C++17) std::any class template
|
||||
#include <optional> // (since C++17) std::optional class template
|
||||
#include <variant> // (since C++17) std::variant class template
|
||||
#include <memory_resource> // (since C++17) Polymorphic allocators and memory resources
|
||||
#include <string_view> // (since C++17) std::basic_string_view class template
|
||||
#include <execution> // (since C++17) Predefined execution policies for parallel versions of the algorithms
|
||||
#include <filesystem> // (since C++17) std::path class and supporting functions
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
# Launchers File syntax:
|
||||
#
|
||||
# [Must-have property line]
|
||||
# launcher1.runCommand=<Run Command>
|
||||
# [Optional extra properties]
|
||||
# launcher1.displayName=<Display Name, runCommand by default>
|
||||
# launcher1.hide=<true if lancher is not visible in menu, false by default>
|
||||
# launcher1.buildCommand=<Build Command, Build Command specified in project properties by default>
|
||||
# launcher1.runDir=<Run Directory, ${PROJECT_DIR} by default>
|
||||
# launcher1.runInOwnTab=<false if launcher reuse common "Run" output tab, true by default>
|
||||
# launcher1.symbolFiles=<Symbol Files loaded by debugger, ${OUTPUT_PATH} by default>
|
||||
# launcher1.env.<Environment variable KEY>=<Environment variable VALUE>
|
||||
# (If this value is quoted with ` it is handled as a native command which execution result will become the value)
|
||||
# [Common launcher properties]
|
||||
# common.runDir=<Run Directory>
|
||||
# (This value is overwritten by a launcher specific runDir value if the latter exists)
|
||||
# common.env.<Environment variable KEY>=<Environment variable VALUE>
|
||||
# (Environment variables from common launcher are merged with launcher specific variables)
|
||||
# common.symbolFiles=<Symbol Files loaded by debugger>
|
||||
# (This value is overwritten by a launcher specific symbolFiles value if the latter exists)
|
||||
#
|
||||
# In runDir, symbolFiles and env fields you can use these macroses:
|
||||
# ${PROJECT_DIR} - project directory absolute path
|
||||
# ${OUTPUT_PATH} - linker output path (relative to project directory path)
|
||||
# ${OUTPUT_BASENAME}- linker output filename
|
||||
# ${TESTDIR} - test files directory (relative to project directory path)
|
||||
# ${OBJECTDIR} - object files directory (relative to project directory path)
|
||||
# ${CND_DISTDIR} - distribution directory (relative to project directory path)
|
||||
# ${CND_BUILDDIR} - build directory (relative to project directory path)
|
||||
# ${CND_PLATFORM} - platform name
|
||||
# ${CND_CONF} - configuration name
|
||||
# ${CND_DLIB_EXT} - dynamic library extension
|
||||
#
|
||||
# All the project launchers must be listed in the file!
|
||||
#
|
||||
# launcher1.runCommand=...
|
||||
# launcher2.runCommand=...
|
||||
# ...
|
||||
# common.runDir=...
|
||||
# common.env.KEY=VALUE
|
||||
# launcher1.runCommand=<type your run command here>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<code-assistance-data xmlns="http://www.netbeans.org/ns/make-project-private/1">
|
||||
<code-model-enabled>true</code-model-enabled>
|
||||
</code-assistance-data>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project-private/1">
|
||||
<activeConfTypeElem>0</activeConfTypeElem>
|
||||
<activeConfIndexElem>2</activeConfIndexElem>
|
||||
</data>
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group>
|
||||
<file>file:/C:/Users/Corwin%20Perren/Documents/GitHub/CS372/Project%202/ftserver/main.c</file>
|
||||
</group>
|
||||
</open-files>
|
||||
</project-private>
|
||||
@@ -0,0 +1,12 @@
|
||||
#Sun Mar 12 19:01:23 PDT 2017
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\ftserver\\readme.txt=c1489368909923
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\ftserver\\main.c=c1489370468713
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\ftserver\\makefile=c1489370361205
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\makefile=c1489273319134
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\ftserver\\test.txt=c1489366921247
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\nbproject\\project.xml=c1489273368181
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\ftserver\\nbproject\\project.xml=c1489282526002
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\ftserver\\ftserver.h=c1489369511696
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\ftserver\\nbproject\\launcher.properties=c1489281599394
|
||||
c\:\\users\\corwin\ perren\\documents\\github\\cs372\\project\ 2\\ftserver\\ftserver.c=c1489370236087
|
||||
VERSION=1.3
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.cnd.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
<name>Project 2</name>
|
||||
<c-extensions>c</c-extensions>
|
||||
<cpp-extensions/>
|
||||
<header-extensions>h</header-extensions>
|
||||
<sourceEncoding>UTF-8</sourceEncoding>
|
||||
<make-dep-projects/>
|
||||
<sourceRootList>
|
||||
<sourceRootElem>.</sourceRootElem>
|
||||
</sourceRootList>
|
||||
<confList>
|
||||
<confElem>
|
||||
<name>Remote_no_args</name>
|
||||
<type>0</type>
|
||||
</confElem>
|
||||
<confElem>
|
||||
<name>Remote_32021</name>
|
||||
<type>0</type>
|
||||
</confElem>
|
||||
<confElem>
|
||||
<name>Remote_33021</name>
|
||||
<type>0</type>
|
||||
</confElem>
|
||||
</confList>
|
||||
<formatting>
|
||||
<project-formatting-style>false</project-formatting-style>
|
||||
</formatting>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user